您尚未登录。

楼主 # 2024-12-18 21:26:06

memory
会员
注册时间: 2021-08-11
已发帖子: 487
积分: 464

Android10 主界面禁用下拉菜单,关闭主菜单,这样app就无法跳出到桌面了

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java

    public boolean panelsEnabled() {
        final int disabled1 = getDisabled1(DEFAULT_DISPLAY);
        final int disabled2 = getDisabled2(DEFAULT_DISPLAY);
        return (disabled1 & StatusBarManager.DISABLE_EXPAND) == 0
                && (disabled2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) == 0
                && !ONLY_CORE_APPS;
    }
    public boolean panelsEnabled() {
    return false;
    }

离线

楼主 #2 2024-12-18 22:06:24

memory
会员
注册时间: 2021-08-11
已发帖子: 487
积分: 464

Re: Android10 主界面禁用下拉菜单,关闭主菜单,这样app就无法跳出到桌面了

关闭主菜单

device/softwinner/xxx-yyy/overlay/frameworks/base/core/res/res/values/config.xml

    <bool name="config_showNavigationBar">true</bool>

改为:

    <bool name="config_showNavigationBar">false</bool>

离线

楼主 #3 2024-12-20 19:38:44

memory
会员
注册时间: 2021-08-11
已发帖子: 487
积分: 464

Re: Android10 主界面禁用下拉菜单,关闭主菜单,这样app就无法跳出到桌面了

命令行调整背光亮度:

input keyevent BRIGHTNESS_DOWN
input keyevent BRIGHTNESS_UP

离线

楼主 #4 2024-12-20 21:04:38

memory
会员
注册时间: 2021-08-11
已发帖子: 487
积分: 464

Re: Android10 主界面禁用下拉菜单,关闭主菜单,这样app就无法跳出到桌面了

请问安卓SDK如何控制屏幕亮度最小值,防止被用户设置全黑
https://whycan.com/t_11679.html


安卓SDK如何控制屏幕亮度最小值,防止被用户设置全黑

修改 device/softwinner/xxx-yyy/overlay/frameworks/base/core/res/res/values/config.xml

    <integer name="config_screenBrightnessSettingMinimum">8</integer>

改成

    <integer name="config_screenBrightnessSettingMinimum">12</integer>


---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------

客户反应 A133背光调节不够线性

frameworks/base/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java

源代码:

    public static final int convertGammaToLinear(int val, int min, int max) {
        final float normalizedVal = MathUtils.norm(0, GAMMA_SPACE_MAX, val);
        final float ret;
        if (normalizedVal <= R) {
            ret = MathUtils.sq(normalizedVal / R);
        } else {
            ret = MathUtils.exp((normalizedVal - C) / A) + B;
        }

        // HLG is normalized to the range [0, 12], so we need to re-normalize to the range [0, 1]
        // in order to derive the correct setting value.
        return Math.round(MathUtils.lerp(min, max, ret / 12));
    }

添加调试后:

    public static final int convertGammaToLinear(int val, int min, int max) {
        final float normalizedVal = MathUtils.norm(0, GAMMA_SPACE_MAX, val);
        final float ret;
        if (normalizedVal <= R) {
            ret = MathUtils.sq(normalizedVal / R);
        } else {
            ret = MathUtils.exp((normalizedVal - C) / A) + B;
        }

	int x = Math.round(MathUtils.lerp(min, max, ret / 12));

	String message = String.format("----> linear min->%d, max=%d, val=%04d, x=%03d", min, max, val, x);
	Log.e("AAAA", message);

        // HLG is normalized to the range [0, 12], so we need to re-normalize to the range [0, 1]
        // in order to derive the correct setting value.
        return x;
    }

从左拖到右:

12-20 21:04:52.384  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=000, x=012
12-20 21:04:52.386  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=081, x=013
12-20 21:04:52.561  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=095, x=013
12-20 21:04:52.577  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=194, x=015
12-20 21:04:52.595  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=289, x=018
12-20 21:04:52.612  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=384, x=023
12-20 21:04:52.627  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=440, x=027
12-20 21:04:52.645  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=507, x=032
12-20 21:04:52.661  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=564, x=037
12-20 21:04:52.679  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=620, x=044
12-20 21:04:52.695  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=677, x=054
12-20 21:04:52.711  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=729, x=065
12-20 21:04:52.727  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=781, x=081
12-20 21:04:52.745  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=838, x=104
12-20 21:04:52.761  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=876, x=124
12-20 21:04:52.777  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=909, x=145
12-20 21:04:52.796  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=938, x=167
12-20 21:04:52.811  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=980, x=205
12-20 21:04:52.828  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=1014, x=244
12-20 21:04:52.844  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=1023, x=255
12-20 21:04:53.085  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=1023, x=255
12-20 21:04:53.097  2237  2237 E AAAA    : AAAA ----> linear min->12, max=255, val=1023, x=255

离线

楼主 #5 2024-12-20 21:10:19

memory
会员
注册时间: 2021-08-11
已发帖子: 487
积分: 464

Re: Android10 主界面禁用下拉菜单,关闭主菜单,这样app就无法跳出到桌面了

看来得自己做一个对照表,

进度条是 [0..1023] <===> pwm值 [12..255]

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn