Skip to content
Snippets Groups Projects
Commit e21f2883 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Support DISABLE_NAVIGATION on phones.

Bug: 5161286
Change-Id: I6a2c3053423c2b34136b0c3889f575f9c082d7e9
parent 7fa6e424
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@ public class NavigationBarView extends LinearLayout {
boolean mVertical;
boolean mHidden;
boolean mEnabled = true;
public View getRecentsButton() {
return mCurrentView.findViewById(R.id.recent_apps);
......@@ -81,6 +82,11 @@ public class NavigationBarView extends LinearLayout {
mVertical = false;
}
public void setEnabled(final boolean enable) {
mEnabled = enable;
mCurrentView.setVisibility(enable ? View.VISIBLE : View.INVISIBLE);
}
public void setHidden(final boolean hide) {
if (hide == mHidden) return;
......
......@@ -1048,12 +1048,30 @@ public class PhoneStatusBar extends StatusBar {
final int diff = state ^ old;
mDisabled = state;
if (DEBUG) {
Slog.d(TAG, String.format("disable: 0x%08x -> 0x%08x (diff: 0x%08x)",
old, state, diff));
}
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
Slog.d(TAG, "DISABLE_EXPAND: yes");
animateCollapse();
}
}
if ((diff & StatusBarManager.DISABLE_NAVIGATION) != 0) {
if ((state & StatusBarManager.DISABLE_NAVIGATION) != 0) {
Slog.d(TAG, "DISABLE_NAVIGATION: yes");
// close recents if it's visible
mHandler.removeMessages(MSG_CLOSE_RECENTS_PANEL);
mHandler.sendEmptyMessage(MSG_CLOSE_RECENTS_PANEL);
}
mNavigationBarView.setEnabled((state & StatusBarManager.DISABLE_NAVIGATION) == 0);
}
if ((diff & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
if ((state & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
Slog.d(TAG, "DISABLE_NOTIFICATION_ICONS: yes");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment