RK3288[android 7.1]调试笔记 隐藏底部状态栏截屏按钮
修改frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java文件
dongsy@build-server-100:~/work/dsy/3288_haier/work/3288-7.1/haier/frameworks(master)$ git diff base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
diff --git a/haier/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/haier/frameworks/ba
index f55d1f7..7fded5d 100755
--- a/haier/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/haier/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -477,8 +477,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
final private ContentObserver screenshotShowObserver = new ContentObserver(mHandler) {
@Override
public void onChange(boolean selfChange) {
- boolean isShow = Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREENSHOT_BUTTON_SHOW, 1) == 1;
- ButtonDispatcher screenshotButton = mNavigationBarView.getScreenshotButton();
+ //20190809 modified by elink_dongsy for hide screenshot capture virtual buttons start
+ boolean isShow = Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREENSHOT_BUTTON_SHOW, 0) == 0;
+ //20190809 modified by elink_dongsy for hide screenshot capture virtual buttons end
+ ButtonDispatcher screenshotButton = mNavigationBarView.getScreenshotButton();
screenshotButton.setVisibility(isShow ? View.VISIBLE : View.GONE);//这里是通过判断isShow值为1,则状态为View.VISIBLE 在底部状态栏显示截屏按钮;isShow值为0,则状态为View.GONE在底部状态栏上隐藏截屏按钮
}
};
@@ -1461,8 +1463,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
screenshotButton.setOnClickListener(mScreenshotClickListener);
screenshotButton.setOnTouchListener(mScreenshotTouchListener);
screenshotButton.setVisibility(View.VISIBLE);
- boolean isShow=Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREENSHOT_BUTTON_SHOW, 1)==1;
- if(isShow){
+ //20190809 modified by elink_dongsy for hide screenshot capture virtual buttons start
+ boolean isShow=Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREENSHOT_BUTTON_SHOW, 0)==0;
+ //20190809 modified by elink_dongsy for hide screenshot capture virtual buttons end
+ if(isShow){ //如果isShow值为1,则 状态为View.VISIBLE 在底部状态栏显示截屏按钮
screenshotButton.setVisibility(View.VISIBLE);
}else{//否则isShow值为0,则状态为View.GONE在底部状态栏上隐藏截屏按钮
screenshotButton.setVisibility(View.GONE);
根据我们现在修改的方式代码是默认在底部状态栏上隐藏截屏按钮,所以需要修改以下文件
修改/packages/apps/Settings/res/values/strings.xml文件
dongsy@build-server-100:~/work/dsy/3288_haier/work/3288-7.1/haier/frameworks(master)$ git diff ../packages/apps/Settings/res/values/strings.xml
diff --git a/haier/packages/apps/Settings/res/values/strings.xml b/haier/packages/apps/Settings/res/values/strings.xml
index a895fb6..ef911d1 100755
--- a/haier/packages/apps/Settings/res/values/strings.xml
+++ b/haier/packages/apps/Settings/res/values/strings.xml
@@ -7936,7 +7936,9 @@
<string name="app_name">ScreenshotManager</string>
<string name="screenshot_manager">ScreenshotSetting</string>
<string name="screenshot_delay_title">Select delay time to capture the screen </string>
- <string name="screenshot_show">Show the screenshot button in the statusbar</string>
+ <!--20190809 modified by elink_dongsy for hide screenshot capture virtual buttons start -->
+ <string name="screenshot_show">Hide the screenshot button in the statusbar</string>
+ <!--20190809 modified by elink_dongsy for hide screenshot capture virtual buttons end -->
<string name="screenshot_version">Show the version of screenshot manager.</string>
<string name="screenshot_storage_title">Set the location of screenshot storage</string>
<string name="later">s later capture</string>
修改/packages/apps/Settings/res/values-zh-rCN/strings.xml文件
dongsy@build-server-100:~/work/dsy/3288_haier/work/3288-7.1/haier/frameworks(master)$ git diff ../packages/apps/Settings/res/values-zh-rCN/strings.xml
diff --git a/haier/packages/apps/Settings/res/values-zh-rCN/strings.xml b/haier/packages/apps/Settings/res/values-zh-rCN/strings.xml
index 8fff2ff..2951ab0 100755
--- a/haier/packages/apps/Settings/res/values-zh-rCN/strings.xml
+++ b/haier/packages/apps/Settings/res/values-zh-rCN/strings.xml
@@ -3258,7 +3258,9 @@
<string name="app_name">截屏管理器</string>
<string name="screenshot_manager">截屏设置</string>
<string name="screenshot_delay_title">延时截屏设置 </string>
- <string name="screenshot_show">在状态栏上显示截屏按钮</string>
+ <!--20190809 modified by elink_dongsy for hide screenshot capture virtual buttons start -->
+ <string name="screenshot_show">在状态栏上隐藏截屏按钮</string>
+ <!--20190809 modified by elink_dongsy for hide screenshot capture virtual buttons end -->
<string name="screenshot_version">截屏管理器版本</string>
<string name="screenshot_storage_title">设置截屏图片存储位置</string>