diff options
| author | 2016-02-09 10:33:01 -0800 | |
|---|---|---|
| committer | 2016-02-09 10:33:01 -0800 | |
| commit | d592191b7405b9ccab509a12e5b05e48f323e03f (patch) | |
| tree | e4e7c24f295d8ff9dddc1509af18e918c2a6cb5a | |
| parent | 3776fe007550451bb237c705d333247eab2a291c (diff) | |
Improved the heads up logic to launch fullscreen intents less
Fullscreen intents are always less distracting when heads upped
instead of launched fullscreen, so when snoozed or if the ranking
isn't high enough we now prefer HUN instead of simply launching
it.
Change-Id: Iae16d35c6a6d3f11f3d1f6db6e1dc067018a5172
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 7d37ad22223f..af06d1ed39f3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -2080,25 +2080,44 @@ public abstract class BaseStatusBar extends SystemUI implements return false; } - if (isSnoozedPackage(sbn)) { - if (DEBUG) Log.d(TAG, "No peeking: snoozed package: " + sbn.getKey()); + boolean inUse = mPowerManager.isScreenOn() + && (!mStatusBarKeyguardViewManager.isShowing() + || mStatusBarKeyguardViewManager.isOccluded()) + && !mStatusBarKeyguardViewManager.isInputRestricted(); + try { + inUse = inUse && !mDreamManager.isDreaming(); + } catch (RemoteException e) { + Log.d(TAG, "failed to query dream manager", e); + } + + if (!inUse) { + if (DEBUG) { + Log.d(TAG, "No peeking: not in use: " + sbn.getKey()); + } return false; } - if (entry.hasJustLaunchedFullScreenIntent()) { - if (DEBUG) Log.d(TAG, "No peeking: recent fullscreen: " + sbn.getKey()); + if (mNotificationData.shouldSuppressScreenOn(sbn.getKey())) { + if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey()); return false; } - if (sbn.getNotification().fullScreenIntent != null - && mAccessibilityManager.isTouchExplorationEnabled()) { - if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); + if (entry.hasJustLaunchedFullScreenIntent()) { + if (DEBUG) Log.d(TAG, "No peeking: recent fullscreen: " + sbn.getKey()); return false; } + if (sbn.getNotification().fullScreenIntent != null) { + if (mAccessibilityManager.isTouchExplorationEnabled()) { + if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); + return false; + } else { + return true; + } + } - if (mNotificationData.shouldSuppressScreenOn(sbn.getKey())) { - if (DEBUG) Log.d(TAG, "No peeking: suppressed by DND: " + sbn.getKey()); + if (isSnoozedPackage(sbn)) { + if (DEBUG) Log.d(TAG, "No peeking: snoozed package: " + sbn.getKey()); return false; } @@ -2107,17 +2126,7 @@ public abstract class BaseStatusBar extends SystemUI implements return false; } - boolean inUse = mPowerManager.isScreenOn() - && (!mStatusBarKeyguardViewManager.isShowing() - || mStatusBarKeyguardViewManager.isOccluded()) - && !mStatusBarKeyguardViewManager.isInputRestricted(); - try { - inUse = inUse && !mDreamManager.isDreaming(); - } catch (RemoteException e) { - Log.d(TAG, "failed to query dream manager", e); - } - if (DEBUG) Log.d(TAG, "peek if device in use: " + inUse); - return inUse; + return true; } protected abstract boolean isSnoozedPackage(StatusBarNotification sbn); |