目录
1、隐藏导航栏
diff --git a/packages/SystemUI/res/layout/navigation_bar.xml b/packages/SystemUI/res/layout/navigation_bar.xml
index ba6b6956f187..e2cf28c39d7e 100644
--- a/packages/SystemUI/res/layout/navigation_bar.xml
+++ b/packages/SystemUI/res/layout/navigation_bar.xml
@@ -22,6 +22,7 @@
xmlns:systemui="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
+ android:visibility="gone"
android:background="@drawable/system_bar_background">
<com.android.systemui.CornerHandleView
@@ -42,6 +43,7 @@
<com.android.systemui.statusbar.phone.NavigationBarInflaterView
android:id="@+id/navigation_inflater"
android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ android:layout_height="match_parent"
+ android:visibility="gone"/>
</com.android.systemui.statusbar.phone.NavigationBarView>
2、隐藏状态栏
diff --git a/packages/SystemUI/res/layout/status_bar.xml b/packages/SystemUI/res/layout/status_bar.xml
index f8db97dbf800..b5ae9cc80c60 100644
--- a/packages/SystemUI/res/layout/status_bar.xml
+++ b/packages/SystemUI/res/layout/status_bar.xml
@@ -26,6 +26,7 @@
android:id="@+id/status_bar"
android:orientation="vertical"
android:focusable="false"
+ android:visibility="gone"
android:descendantFocusability="afterDescendants"
android:accessibilityPaneTitle="@string/status_bar"
>
3、屏蔽下滑状态栏
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 96d6ecbcc07f..4f3037015ca0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -371,11 +371,12 @@ public class CommandQueue extends IStatusBar.Stub implements CallbackController<
// TODO(b/118592525): add multi-display support if needed.
public boolean panelsEnabled() {
- final int disabled1 = getDisabled1(DEFAULT_DISPLAY);
+ return false;
+ /*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;
+ && !ONLY_CORE_APPS;*/
}
public void addCallback(Callbacks callbacks) {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
index 790b2585190d..4b4e5b828665 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
@@ -185,37 +185,37 @@ public class OverviewProxyService extends CurrentUserTracker implements
// TODO: change the method signature to use (boolean inputFocusTransferStarted)
@Override
public void onStatusBarMotionEvent(MotionEvent event) {
- if (!verifyCaller("onStatusBarMotionEvent")) {
- return;
- }
- long token = Binder.clearCallingIdentity();
- try {
- // TODO move this logic to message queue
- mStatusBarOptionalLazy.ifPresent(statusBarLazy -> {
- mHandler.post(()-> {
- StatusBar statusBar = statusBarLazy.get();
- int action = event.getActionMasked();
- if (action == ACTION_DOWN) {
- mInputFocusTransferStarted = true;
- mInputFocusTransferStartY = event.getY();
- mInputFocusTransferStartMillis = event.getEventTime();
- statusBar.onInputFocusTransfer(
- mInputFocusTransferStarted, false /* cancel */,
- 0 /* velocity */);
- }
- if (action == ACTION_UP || action == ACTION_CANCEL) {
- mInputFocusTransferStarted = false;
- statusBar.onInputFocusTransfer(mInputFocusTransferStarted,
- action == ACTION_CANCEL,
- (event.getY() - mInputFocusTransferStartY)
- / (event.getEventTime() - mInputFocusTransferStartMillis));
- }
- event.recycle();
- });
- });
- } finally {
- Binder.restoreCallingIdentity(token);
- }
}
@Override
已验证过,是可行的,希望能帮助大家。