diff options
| author | Beverly <beverlyt@google.com> | 2019-05-22 17:57:39 -0400 |
|---|---|---|
| committer | Beverly <beverlyt@google.com> | 2019-05-28 12:57:27 -0400 |
| commit | 54fead82f5aa636b1144274a097581fc05c81781 (patch) | |
| tree | 543751f9605f34f2044af102a3febebaebfc0f0d /core/java/android/app/StatusBarManager.java | |
| parent | fef3b40787704c4f1624e35451a6ef62ba52ec9a (diff) | |
Add disable methods in StatusBarManager
Test: manual
Bug: 132844641
Change-Id: Ibee48629c6ddb523cafa45238668cb00553f2d5b
Diffstat (limited to 'core/java/android/app/StatusBarManager.java')
| -rw-r--r-- | core/java/android/app/StatusBarManager.java | 64 |
1 files changed, 62 insertions, 2 deletions
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java index af2d774508c4..205e7a13092b 100644 --- a/core/java/android/app/StatusBarManager.java +++ b/core/java/android/app/StatusBarManager.java @@ -433,6 +433,9 @@ public class StatusBarManager { private boolean mNotificationPeeking; private boolean mRecents; private boolean mSearch; + private boolean mSystemIcons; + private boolean mClock; + private boolean mNotificationIcons; /** @hide */ public DisableInfo(int flags1, int flags2) { @@ -441,6 +444,9 @@ public class StatusBarManager { mNotificationPeeking = (flags1 & DISABLE_NOTIFICATION_ALERTS) != 0; mRecents = (flags1 & DISABLE_RECENT) != 0; mSearch = (flags1 & DISABLE_SEARCH) != 0; + mSystemIcons = (flags1 & DISABLE_SYSTEM_INFO) != 0; + mClock = (flags1 & DISABLE_CLOCK) != 0; + mNotificationIcons = (flags1 & DISABLE_NOTIFICATION_ICONS) != 0; } /** @hide */ @@ -527,6 +533,48 @@ public class StatusBarManager { } /** + * @return {@code true} if system icons are disabled + * + * @hide + */ + public boolean areSystemIconsDisabled() { + return mSystemIcons; + } + + /** * @hide */ + public void setSystemIconsDisabled(boolean disabled) { + mSystemIcons = disabled; + } + + /** + * @return {@code true} if the clock icon is disabled + * + * @hide + */ + public boolean isClockDisabled() { + return mClock; + } + + /** * @hide */ + public void setClockDisabled(boolean disabled) { + mClock = disabled; + } + + /** + * @return {@code true} if notification icons are disabled + * + * @hide + */ + public boolean areNotificationIconsDisabled() { + return mNotificationIcons; + } + + /** * @hide */ + public void setNotificationIconsDisabled(boolean disabled) { + mNotificationIcons = disabled; + } + + /** * @return {@code true} if no components are disabled (default state) * * @hide @@ -535,7 +583,7 @@ public class StatusBarManager { @TestApi public boolean areAllComponentsEnabled() { return !mStatusBarExpansion && !mNavigateHome && !mNotificationPeeking && !mRecents - && !mSearch; + && !mSearch && !mSystemIcons && !mClock && !mNotificationIcons; } /** @hide */ @@ -545,6 +593,9 @@ public class StatusBarManager { mNotificationPeeking = false; mRecents = false; mSearch = false; + mSystemIcons = false; + mClock = false; + mNotificationIcons = false; } /** @@ -554,7 +605,7 @@ public class StatusBarManager { */ public boolean areAllComponentsDisabled() { return mStatusBarExpansion && mNavigateHome && mNotificationPeeking - && mRecents && mSearch; + && mRecents && mSearch && mSystemIcons && mClock && mNotificationIcons; } /** @hide */ @@ -564,6 +615,9 @@ public class StatusBarManager { mNotificationPeeking = true; mRecents = true; mSearch = true; + mSystemIcons = true; + mClock = true; + mNotificationIcons = true; } @Override @@ -576,6 +630,9 @@ public class StatusBarManager { .append(mNotificationPeeking ? "disabled" : "enabled"); sb.append(" mRecents=").append(mRecents ? "disabled" : "enabled"); sb.append(" mSearch=").append(mSearch ? "disabled" : "enabled"); + sb.append(" mSystemIcons=").append(mSystemIcons ? "disabled" : "enabled"); + sb.append(" mClock=").append(mClock ? "disabled" : "enabled"); + sb.append(" mNotificationIcons=").append(mNotificationIcons ? "disabled" : "enabled"); return sb.toString(); @@ -596,6 +653,9 @@ public class StatusBarManager { if (mNotificationPeeking) disable1 |= DISABLE_NOTIFICATION_ALERTS; if (mRecents) disable1 |= DISABLE_RECENT; if (mSearch) disable1 |= DISABLE_SEARCH; + if (mSystemIcons) disable1 |= DISABLE_SYSTEM_INFO; + if (mClock) disable1 |= DISABLE_CLOCK; + if (mNotificationIcons) disable1 |= DISABLE_NOTIFICATION_ICONS; return new Pair<Integer, Integer>(disable1, disable2); } |
