diff options
author | John Spurlock <jspurlock@google.com> | 2013-05-21 17:19:53 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2013-05-28 13:09:23 -0400 |
commit | dcf4f2146097eeae6991e6131e5ae96b33fbeda9 (patch) | |
tree | 65b4e52a12595dd7678a92ec91888ad52f70469e /services/java/com/android/server/NotificationManagerService.java | |
parent | dadfb9c9bfe17eb99a4891af0fe4eed7166f0b86 (diff) |
Hideybars feature confirmation toast bar.
Enhance Toast to support new standard toast bar style, similar
to the undo bar in Gmail. Toast bars can be interactive,
and can have a single action. Add a new toast duration to
indicate persistent toasts (no auto-hide delay).
Use the new toast bar to implement a feature hint when hiding
the navigation bar in hideybars mode.
Per UX, the feature confirmation bar can also be dismissed on
any outside touch as long as the user confirmed it using the
OK button at least once globally.
Bug: 8754108
Change-Id: Iaa85d3b4da7ada1952a562f1e31de04380f5d587
Diffstat (limited to 'services/java/com/android/server/NotificationManagerService.java')
-rw-r--r-- | services/java/com/android/server/NotificationManagerService.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 04773db67d13..f4065ed0ef89 100644 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -1476,7 +1476,7 @@ public class NotificationManagerService extends INotificationManager.Stub if (DBG) Slog.d(TAG, "Show pkg=" + record.pkg + " callback=" + record.callback); try { record.callback.show(); - scheduleTimeoutLocked(record, false); + scheduleTimeoutLocked(record); return; } catch (RemoteException e) { Slog.w(TAG, "Object died trying to show notification " + record.callback @@ -1516,12 +1516,14 @@ public class NotificationManagerService extends INotificationManager.Stub } } - private void scheduleTimeoutLocked(ToastRecord r, boolean immediate) + private void scheduleTimeoutLocked(ToastRecord r) { - Message m = Message.obtain(mHandler, MESSAGE_TIMEOUT, r); - long delay = immediate ? 0 : (r.duration == Toast.LENGTH_LONG ? LONG_DELAY : SHORT_DELAY); mHandler.removeCallbacksAndMessages(r); - mHandler.sendMessageDelayed(m, delay); + if (r.duration != Toast.LENGTH_INFINITE) { + Message m = Message.obtain(mHandler, MESSAGE_TIMEOUT, r); + long delay = r.duration == Toast.LENGTH_LONG ? LONG_DELAY : SHORT_DELAY; + mHandler.sendMessageDelayed(m, delay); + } } private void handleTimeout(ToastRecord record) |