临邑建设局网站,wordpress两个头部,所有免费的网站有哪些,wordpress中headcode一、背景
在台式POS场景下#xff0c;经常有应用会需要获取霸屏的权限#xff0c;隐藏状态栏或者导航栏#xff0c;且不能被划出#xff0c;其实系统已经系统了隐藏状态栏也导航栏的接口#xff0c;但是无法做到禁止滑出。
View decorView ((Activity) context).getWin…一、背景
在台式POS场景下经常有应用会需要获取霸屏的权限隐藏状态栏或者导航栏且不能被划出其实系统已经系统了隐藏状态栏也导航栏的接口但是无法做到禁止滑出。
View decorView ((Activity) context).getWindow().getDecorView();int uiOptions View.SYSTEM_UI_FLAG_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;decorView.setSystemUiVisibility(uiOptions);二、霸屏实现
通过广播形式实现
1.在systemui中增加广播定义
diff --git a/vendor/mediatek/proprietary/packages/apps/SystemUI/AndroidManifest.xml b/vendor/mediatek/proprietary/packages/apps/SystemUI/AndroidManifest.xml
index 6420244..9dab3d4 100644
--- a/vendor/mediatek/proprietary/packages/apps/SystemUI/AndroidManifest.xmlb/vendor/mediatek/proprietary/packages/apps/SystemUI/AndroidManifest.xml-342,6 342,12 protected-broadcast android:namecom.android.settingslib.action.UNREGISTER_SLICE_RECEIVER /protected-broadcast android:namecom.android.settings.flashlight.action.FLASHLIGHT_CHANGED / protected-broadcast android:namecom.systemui.statusbar.show /protected-broadcast android:namecom.systemui.statusbar.hide /protected-broadcast android:namecom.systemui.navigationbar.show /protected-broadcast android:namecom.systemui.navigationbar.hide /
applicationandroid:name.SystemUIApplicationandroid:persistenttrue
2.增加广播的监听
diff --git a/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index a853747..70d1586 100644
--- a/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.javab/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java-287,6 287,13 public class CentralSurfacesImpl extends CoreStartable implementsprivate static final int MSG_LAUNCH_TRANSITION_TIMEOUT 1003;// 1020-1040 reserved for BaseStatusBarprivate static final String ACTION_HIDE_STATUS_BAR com.systemui.statusbar.hide;private static final String ACTION_SHOW_STATUS_BAR com.systemui.statusbar.show;private static final String ACTION_HIDE_NAVIGATION_BAR com.systemui.navigationbar.hide;private static final String ACTION_SHOW_NAVIGATION_BAR com.systemui.navigationbar.show;private static final String SYS_PROPERTY_STATUS_BAR persist.sys.statusbar.enable;private static final String SYS_PROPERTY_NAVIGATION_BAR persist.sys.navigationbar.enable;/*** The delay to reset the hint text when the hint animation is finished running.*/-969,6 976,10 public class CentralSurfacesImpl extends CoreStartable implementscreateAndAddWindows(result); if (!SystemProperties.getBoolean(SYS_PROPERTY_STATUS_BAR, false)) {mStatusBarWindowController.setBarVisibility(View.GONE);}
if (mWallpaperSupported) {// Make sure we always have the most current wallpaper info.IntentFilter wallpaperChangedFilter new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED);-1216,7 1227,9 public class CentralSurfacesImpl extends CoreStartable implements}mNotificationPanelViewController.setHeadsUpManager(mHeadsUpManager);- createNavigationBar(result);if (SystemProperties.getBoolean(SYS_PROPERTY_NAVIGATION_BAR, false)) {createNavigationBar(result);}if (ENABLE_LOCKSCREEN_WALLPAPER mWallpaperSupported) {mLockscreenWallpaper mLockscreenWallpaperLazy.get();-1454,6 1467,10 public class CentralSurfacesImpl extends CoreStartable implementsIntentFilter filter new IntentFilter();filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);filter.addAction(Intent.ACTION_SCREEN_OFF);filter.addAction(ACTION_HIDE_NAVIGATION_BAR);filter.addAction(ACTION_SHOW_NAVIGATION_BAR);filter.addAction(ACTION_HIDE_STATUS_BAR);filter.addAction(ACTION_SHOW_STATUS_BAR);mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, filter, null, UserHandle.ALL);} -2729,6 2746,18 public class CentralSurfacesImpl extends CoreStartable implements}finishBarAnimations();resetUserExpandedStates();} else if (ACTION_HIDE_NAVIGATION_BAR.equals(action)) {mNavigationBarController.removeNavigationBars();SystemProperties.set(SYS_PROPERTY_NAVIGATION_BAR, false);} else if (ACTION_SHOW_NAVIGATION_BAR.equals(action)) {createNavigationBar(null);SystemProperties.set(SYS_PROPERTY_NAVIGATION_BAR, true);} else if (ACTION_HIDE_STATUS_BAR.equals(action)) {mStatusBarWindowController.setBarVisibility(View.GONE);SystemProperties.set(SYS_PROPERTY_STATUS_BAR, false);} else if (ACTION_SHOW_STATUS_BAR.equals(action)) {mStatusBarWindowController.setBarVisibility(View.VISIBLE);SystemProperties.set(SYS_PROPERTY_STATUS_BAR, true);}Trace.endSection();}
3.针对广播监听增加对应接口实现
diff --git a/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java b/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java
index d756af7..97a7744 100644
--- a/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.javab/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java-353,6 353,13 public class NavigationBarController implements}} public void removeNavigationBars() {Display[] displays mDisplayManager.getDisplays();for (Display display : displays) {removeNavigationBar(display.getDisplayId());}}
/** see NavigationBar#checkNavBarModes() */public void checkNavBarModes(int displayId) {NavigationBar navBar mNavigationBars.get(displayId);
diff --git a/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java b/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java
index e0d780a..beef9aa 100644
--- a/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.javab/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.java-250,6 250,10 public class StatusBarWindowController {apply(mCurrentState);} public void setBarVisibility(int visibility) {mStatusBarWindowView.setVisibility(visibility);}
/*** Sets whether an ongoing process requires the status bar to be forced visible.*
三、重新编译systemui并测试
am broadcast -a com.systemui.statusbar.show #状态显示
am broadcast -a com.systemui.statusbar.hide #状态栏隐藏
am broadcast -a com.systemui.navigationbar.show #导航栏显示
am broadcast -a com.systemui.navigationbar.hide #导航栏隐藏注意广播需要root权限或者system权限如果普通应用想具备此权限需要修改广播的定义大家可根据自己需求修改