在安卓低系统版本,比如安卓10,11系统,长按power电源键弹出的关机重启对话框中会有截屏按钮,到了安卓13系统就没有了,而且按照谷歌最新GMS要求,从安卓13开始,长按power键必须弹出的是谷歌语音助手,否则GMS测试通不过,但是用户一般都习惯了弹关机重启按钮,所以很多客户会要求改成低系统版本的样式,在安卓13系统中,将长按power键改成弹关机重启对话框的修改方法如下:
到frameworks/base/core/res/res/values/config.xml文件中将config_longPressOnPowerBehavior属性改成1,默认应该是5,5就是弹出谷歌语音助手
即便是将config_longPressOnPowerBehavior改成1,长按power键会弹出关机重启对话框,但是对话框里只有关机和重启按钮,没有截屏按钮,所以还需做如下修改:
frameworks/base/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
index 627968059a62..fd51dd139afb 100755 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java @@ -973,7 +973,7 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene public boolean shouldShow() { // Include screenshot in power menu for legacy nav because it is not accessible // through Recents in that mode - return is2ButtonNavigationEnabled(); + return true;//is2ButtonNavigationEnabled(); } boolean is2ButtonNavigationEnabled() {