92 Commits

Author SHA1 Message Date
Daniel Sandler
205ec5a969 Clean up the Builder test.
Improved vibration coverage
 Fixed LED color
 Added priority
 Added a start delay (for testing LED while screen off)

Change-Id: I3dab0a1a7494f0fe7631d1af49c0fb9a1fdd3f63
2012-11-14 16:42:04 -05:00
Daniel Sandler
b9d36649ca Properly show emoji in the notification ticker.
Add an emoji test to StatusBarTest (working around some
difficulties in actually putting high-Unicode chars in the
layout xml).

Bug: 7378383
Change-Id: Ifce9844b26f67d2799521623e5161aa4dad69ed1
2012-10-19 13:38:11 -04:00
Jeff Brown
1e3b98d47d New internal API to eliminate poke locks.
Added a new WindowManager.LayoutParams inputFeatures flag
to disable automatic user activity behavior when an input
event is sent to a window.

Added a new WindowManager.LayoutParams field userActivityTimeout.

Bug: 7165399
Change-Id: I204eafa37ef26aacc2c52a1ba1ecce1eebb0e0d9
2012-10-01 14:27:34 -07:00
Daniel Sandler
11cf178100 Cleanup internal status bar APIs.
IStatusBarService.collapseQuickSettings is gone;
collapseNotifications is now collapsePanels, which does what
collapse() used to do. Similarly,
IStatusBar.animateCollapseQuickSettings is now simply
IStatusBar.animateCollapse().

Bug: 7245229
Change-Id: Id157d2fdf34926d3c85ffa8b81c741a5359aede4
2012-09-27 14:03:08 -04:00
Svetoslav Ganov
e20a177d3f Adding a global accessibility action to open quick settings.
1. Added APIs for opening the quick settings to the StatusBarManagerService
   and the local StatausBarManager. The new APIs are protected by the old
   EXPAND_STATUS_BAR permission.
   Renamed the expand* and collapse* non-public APIs that are expanding
   the notifications to expandNotifications* collapseNotifications* to
   better convey what they do given that this change adds
   expandQuickSettings* and collapseQuickSettings*.
   Added a global action to the accessibility layer to expand the quick
   settings which is calling into the new status bar manager APIs.

bug:7030487

Change-Id: Ic7b46e1a132f1c0d71355f18e7c5a9a2424171c3
2012-09-25 16:07:59 -07:00
Dianne Hackborn
4120375d46 Remove Binder.getOrigCallingUid().
Replaced all remaining places that used it with explicit user
specification.

While doing this, I ran into stuff that was creating PendingIntent
objects (that now need to specify the explicit user they are for),
which are also posting notifications...  but have no way to specify
the user for the notification.

So the notification manager in the system process now also gets a
formal concept of a user associated with the notification, which
is passed in to all the necessary aidl calls.  I also removed the
old deprecated aidl interface for posting/cancelling notifications,
since we now always need a user supplied.

There is more work that needs to be done here, though.  For example
I think we need to be able to specify USER_ALL for a notification that
should be shown to all users (such as low storage or low battery).
Along with that, the PendingIntent creation needs to be tweaked to
be able to handle USER_CURRENT by evaluating the user at the point the
pending intent is sent.

That's for another change, however.

Change-Id: I468e14dce8def0e13e0870571e7c31ed32b6310c
2012-08-31 15:11:13 -07:00
Jeff Brown
9630704ed3 Power manager rewrite.
The major goal of this rewrite is to make it easier to implement
power management policies correctly.  According, the new
implementation primarily uses state-based rather than event-based
triggers for applying changes to the current power state.

For example, when an application requests that the proximity
sensor be used to manage the screen state (by way of a wake lock),
the power manager makes note of the fact that the set of
wake locks changed.  Then it executes a common update function
that recalculates the entire state, first looking at wake locks,
then considering user activity, and eventually determining whether
the screen should be turned on or off.  At this point it may
make a request to a component called the DisplayPowerController
to asynchronously update the display's powe state.  Likewise,
DisplayPowerController makes note of the updated power request
and schedules its own update function to figure out what needs
to be changed.

The big benefit of this approach is that it's easy to mutate
multiple properties of the power state simultaneously then
apply their joint effects together all at once.  Transitions
between states are detected and resolved by the update in
a consistent manner.

The new power manager service has is implemented as a set of
loosely coupled components.  For the most part, information
only flows one way through these components (by issuing a
request to that component) although some components support
sending a message back to indicate when the work has been
completed.  For example, the DisplayPowerController posts
a callback runnable asynchronously to tell the PowerManagerService
when the display is ready.  An important feature of this
approach is that each component neatly encapsulates its
state and maintains its own invariants.  Moreover, we do
not need to worry about deadlocks or awkward mutual exclusion
semantics because most of the requests are asynchronous.

The benefits of this design are especially apparent in
the implementation of the screen on / off and brightness
control animations which are able to take advantage of
framework features like properties, ObjectAnimator
and Choreographer.

The screen on / off animation is now the responsibility
of the power manager (instead of surface flinger).  This change
makes it much easier to ensure that the animation is properly
coordinated with other power state changes and eliminates
the cause of race conditions in the older implementation.

The because of the userActivity() function has been changed
so that it never wakes the device from sleep.  This change
removes ambiguity around forcing or disabling user activity
for various purposes.  To wake the device, use wakeUp().
To put it to sleep, use goToSleep().  Simple.

The power manager service interface and API has been significantly
simplified and consolidated.  Also fixed some inconsistencies
related to how the minimum and maximum screen brightness setting
was presented in brightness control widgets and enforced behind
the scenes.

At present the following features are implemented:

- Wake locks.
- User activity.
- Wake up / go to sleep.
- Power state broadcasts.
- Battery stats and event log notifications.
- Dreams.
- Proximity screen off.
- Animated screen on / off transitions.
- Auto-dimming.
- Auto-brightness control for the screen backlight with
  different timeouts for ramping up versus ramping down.
- Auto-on when plugged or unplugged.
- Stay on when plugged.
- Device administration maximum user activity timeout.
- Application controlled brightness via window manager.

The following features are not yet implemented:

- Reduced user activity timeout for the key guard.
- Reduced user activity timeout for the phone application.
- Coordinating screen on barriers with the window manager.
- Preventing auto-rotation during power state changes.
- Auto-brightness adjustment setting (feature was disabled
  in previous version of the power manager service pending
  an improved UI design so leaving it out for now).
- Interpolated brightness control (a proposed new scheme
  for more compactly specifying auto-brightness levels
  in config.xml).
- Button / keyboard backlight control.
- Change window manager to associated WorkSource with
  KEEP_SCREEN_ON_FLAG wake lock instead of talking
  directly to the battery stats service.
- Optionally support animating screen brightness when
  turning on/off instead of playing electron beam animation
  (config_animateScreenLights).

Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
2012-08-15 03:06:24 -07:00
Daniel Sandler
e7e9b6e033 Fix NPEs in StatusBarTest.
Change-Id: I9245a297a9a09c09415dd38e662692665ae7e109
2012-05-04 13:31:18 -04:00
Daniel Sandler
bc5559f192 Expand too-small notifications to fill 64dp.
Also fix NotificationTestList so it runs again.

Change-Id: I2fb28cd9cfad25a7a1b17ccef9ccd741c3aa99b0
2012-04-19 01:08:15 -04:00
Jeff Brown
c2346134bb Extract Vibrator implementation from interface.
Moved the core logic of Vibrator into SystemVibrator, potentially
allowing for the creation of other Vibrator subclasses.

Fixed several places where we were creating new Vibrator
instances unnecessarily instead of getting it from the Context.

It is safe to make Vibrator abstract because its constructor
was hidden from the SDK so it was not possible to subclass it.

Bug: 6334179
Change-Id: I18ece6544c26a7efb2d5099f8346a10aef8a5e18
2012-04-13 04:05:17 -07:00
Daniel Sandler
2561b0b10a New notification priority and related APIs.
This change introduces a few new bits of data on
Notification that will help the Notification Manager and
System UI route and display them more intelligently:

 -> priority: an integer in a predefined range that
    indicates the app's best guess as to the relative
    importance (to the user, right now) of that information

 -> kind: a tag (really, set of tags) indicating the general
    type of notification (realtime, asynchronous, etc)

 -> extras: a Bundle of additional key/value pairs
    associated with this notification (currently @hidden)

The notification manager takes these data into account when
assigning to each notification a score which is passed with
the notification on to the system UI, where it can be used to
affect presentation. For example:

  - Spammy apps (identified explicitly by the user or by
    some other means) will have their notifications scored
    very negatively by the notification manager, allowing
    the UI to suppress them
  - Notifications of higher score might be shown larger
    or in a different way
  - Very important notifications (indicated by a very high
    score) might interrupt the user during an otherwise
    important task (videochat, game, etc)

Implementation note: This replaces/extends the old internal
notion of "priority", which was mostly used to organize
ongoings and system notifications at the top of the panel.

Change-Id: Ie063dc75f198a68e2b5734a3aa0cacb5aba1ac39
2012-02-24 13:47:00 -05:00
Daniel Sandler
a3850b6839 Improve handling of small largeIcons in tablet ticker.
The tablet system bar is too short for a full notification
row, but it will show the largeIcon of a new notification in
its full frame, intruding into the main application content
rectangle a bit. This is a good thing---the notifications
really pop out at you---but it looks a little odd if the
largeIcon is actually *small*: the icon is vertically
centered in the larger (invisible) rectangle, making it look
poorly centered on the system bar.

This change will detect short largeIcons and center them in
the system bar's height instead. Additionally, it applies
the same ticker background all the way to the left
underneath largeIcons that are not full-frame (and therefore
have transparent regions).

Bug: 5708907
Bug: 5560485
Change-Id: I32af45632df164c58fb960110063dbaa08b5536c
2011-12-07 15:53:00 -05:00
Daniel Sandler
dba9356590 Break apart DISABLE_HOME and DISABLE_RECENT.
Additionally, start using setSystemUiVisibility() where
possible in the keyguard to allow activities and dialogs to
re-enable some of the navigation keys (notably: home but not
recents).

Finally, stop disabling MENU for activities atop the keyguard.

Bug: 5380495 // no home in driveabout, clock
Bug: 5396134 // able to show home/recent in keyguard
Change-Id: I04eb224554ee8cff79476b85148c4cda75bb0b62
2011-10-13 15:28:10 -04:00
Daniel Sandler
029d5877b0 Hide navigation buttons when they are DISABLEd.
Back is hidden by DISABLE_BACK; Home, Recents, and Menu are
hidden by DISABLE_NAVIGATION.

Bug: 5261576
Bug: 5284740 (confusion about visible inactive icons)
Change-Id: I410c133b737cc11d61bac0318dc24458353ee7b3
2011-09-12 01:02:30 -04:00
Daniel Sandler
542f0510d4 Fix fullScreenAlert test.
Change-Id: I3df0a998347c9e3d21e067381bd22eb9a0862f0d
2011-08-10 22:27:15 -04:00
Daniel Sandler
60ee25643e The fullest of fullscreen modes.
View.setSystemUiVisibility() now properly accepts a
bitfield, including:

  * SYSTEM_UI_FLAG_LOW_PROFILE: "lights out mode"
    (previously known, erroneously, as STATUS_BAR_HIDDEN)

  * SYSTEM_UI_FLAG_HIDE_NAVIGATION: for when you need every
    single pixel on a device that also has a navigation bar

These flags are painstakingly aggregated across the entire
view hierarchy and carefully delivered to the status bar
service, which in turn gently passes them along to the bar
implementation.

To really get access to the whole screen, you need to use
HIDE_NAVIGATION in conjunction with FLAG_FULLSCREEN and
FLAG_LAYOUT_IN_SCREEN. See development/samples/Overscan for
an example of how to do this.

Change-Id: I5fbfe009d9ceebbbf71db73f14a7008ea7c1d4da
2011-07-28 15:18:32 -04:00
Svetoslav Ganov
6179ea3196 Adding accessibility support to the Status Bar.
1. Added content description to pretty much all animals
   in the zoo including buttons in the navigation bar,
   notifications and status icons for battery, signal,
   data, etc.

2. Rectored to avoid ovelaying views since they block
   touch exploratino. In general overlaying views
   cause trouble for touch exploration and accessibility
   in general.

3. Avoid sending accessibility events in case the user is
   touching outside of the StatauBAr panels to avoid
   confusion.

4. Added records to accessibility events in the places where
   this would help the presentation. So the event comes from
   a given "leaf" view and its predecessor is adding a record
   to the event for itself to provide more cotext. It is up
   to the accessiiblity service to choose how to present that.

bug:4686943

Change-Id: I1c1bd123d828fb10911bca92130e9a05c1f020b3
2011-07-21 12:04:54 -07:00
Daniel Sandler
396263fc97 Make the Notify Builder test usable on phones.
Change-Id: Ibaa3b2b99bde7dfd3d9fc6bc4c0068fc1d7b914d
2011-06-16 13:02:02 -04:00
Daniel Sandler
f81c70944a Merge "Fix the status bar test app." 2011-06-04 07:38:08 -07:00
Daniel Sandler
1d4d30aebd It's lights out for you, navigation bar!
Views requesting lights out mode will cause the navbar to
disappear (this is useful for viewing videos/photos/etc
using every pixel of the screen).

But there's a catch: any user activity at all will cause the
lights to come back on and the navbar to return.

Change-Id: I535ed3ba9ae7fab3282c402be256add765395b6f
2011-05-11 09:48:52 -04:00
Daniel Sandler
982cbf1cbc Fix the status bar test app.
Change-Id: Ib7d047a5ed21393ea9cbcdc343cb0cfbb7c62ff7
2011-02-07 11:41:27 -05:00
Daniel Sandler
e40451a89d Ongoing notification for GPS use.
This change improves upon the notification priority API
introduced in change I9e738cc4, allowing privileged clients
to set the priority of a notification when posting it
directly to INotificationManager. StatusBarTest is updated
to test this new feature.

The new LocationController in SystemUI uses this facility to
post a high-priority ongoing notification whenever GPS is in
use (replacing the functionality of the legacy GPS status
bar icon).

Also happens to fix http://b/3325472 (adding a log message
when notifications are dropped because of a missing icon).

Bug: 3412807

Change-Id: I523016ffa53bf979be98ddc4a2deb55a6270c68a
2011-02-03 21:11:46 -05:00
Joe Onorato
7bb8eeb90c Allow the status bar disable flags to be used as View's system ui visibility fields.
Bug: 3363046
Change-Id: I50ba06ed9a4d2f5d0e0c807437aea9900f44fee9
2011-01-27 21:41:24 -08:00
Daniel Sandler
f844dc4fa8 Fit and finish on status bar:
- Clock color fixed. [3374581]
  - Clock vertically aligned. [3388224]
  - Clock uses system font assets now. [3385564]
  - Solid version of AndroidClock added to build. [3385564]
  - Extraneous background glow removed from notification panel.
  - Removed solid black background from notifications. [3388223]
  - Added background image behind large notification icons
    and increased large size to 64dip [3388434, 3384355]
  - Corrected size & leading of notification text [3388577]

Bug: 3374581
Bug: 3384355
Bug: 3385564
Bug: 3388223
Bug: 3388224
Bug: 3388434
Bug: 3388577
Change-Id: I8e443da5758deca412d1ce5944f887b35f6265ed
2011-01-25 16:46:43 -05:00
Joe Onorato
664644d9e0 visibility ("lights out") API.
1. Views may setSystemUiVisibility() to recommend that
the system chrome (status bar or other UI) show or hide
itself.  (This functionality was previously available only
via the FLAG_FULLSCREEN window flag for some SystemUI
implementations.)

2. Views may register a OnSystemUiVisibilityChangedListener
on a view, and find out when the system UI actually
appears or disappears, allowing apps to coordinate the
appearance of their own UI if desired.

Bug: 3241144
Change-Id: Ia1758d94099182d49a1e3688ea2738ae4995b829
2011-01-23 19:22:52 -08:00
Joe Onorato
80a44401a2 Need to update the largeIcon for notifications when we're reapplying the views.
Bug: 3298062
Change-Id: I6bb72c0b93e00a9de8cc2633ac07add0a572a20f
2011-01-15 16:22:24 -08:00
Joe Onorato
c9596d6d8e Possibly fix bad notification updates.
I think what was happening is that it was using a different layout but we were trying to reapply the
RemoveViews because of some bad boolean logic.  This fixes that, and adds some better debugging that
might show us what else is happening.

Bug: 3298062
Change-Id: I0984f24cb2960166c79b9f2cc7c6a98bd75e17ba
2011-01-12 17:06:14 -08:00
Joe Onorato
d070e89396 Make AppWidgetService handle components enabling and disabling.
Change-Id: Ie6b75cb90be38bbce694ccf2d5a342d7f0172fa4
2011-01-10 17:26:39 -08:00
Daniel Sandler
6f6cf3c5e5 Reimplement StatusBarManager.disable(DISABLE_SYSTEM_INFO).
Bug: 3284968
Change-Id: I7171b7770c2972bb56672a771c7ed5ca10fb4dda
2010-12-16 12:54:03 -05:00
Daniel Sandler
3e8f5a2c1b Hide navigation buttons and clock on lockscreen.
(This introduces a StatusBarManager disable flag to ask the
status bar to hide just the clock, which might be useful in
other situations, such as clock/dock apps.)

Bug: 3130393
Change-Id: Ia08627508518e2ed3713ffbf856e4ec42952b3a8
2010-12-03 15:55:04 -05:00
Daniel Sandler
1bfddc8d15 Fix build.
Change-Id: Iccbe1609bbe582180d1c61f908b8dce4d485494b
2010-11-30 16:17:28 -05:00
Daniel Sandler
373a998374 When updating notifications, always reuse the last row.
Ordinarily, changing the "when" slot when updating a
Notification will move its expanded payload to the bottom of
the notification panel's list. But if it's already at the
bottom, this causes an unsightly out-then-in animation
sequence. We now check for that exact situation.

Bug: 3222274
Bug: 3162218
Change-Id: I8b643b3f8bce64e57a22bdbb06d92c196c2484c2
2010-11-30 15:32:55 -05:00
Joe Onorato
8d0b655c49 Add a better notification test and clean up the flag handling in the notification builder.
Change-Id: I9354ed2c2cda690f53e5f43ad60943b63b02e7d4
2010-11-22 16:19:40 -08:00
Joe Onorato
561d3858bb The large icon for notifications.
Change-Id: I8537c602b5b5fca03be8980295bfa28330543669
2010-11-21 16:16:28 -08:00
Joe Onorato
3f76aa7755 Test for using the right size of notification info text.
Change-Id: Iac8764542ddcd3ef0375f6d6d03225e9f6c2fc1c
2010-11-21 16:16:28 -08:00
Joe Onorato
8595a3dd9a Show the number in the expanded notification instead of in the bar.
Change-Id: I248b4fe1732ed290e9f3f9c094de4544a0e396ab
2010-11-21 16:16:28 -08:00
Joe Onorato
46439cec0e Update the look of the notifications. Includes adding a new Notification.Builder class.
Change-Id: I7c57b81c45defe77d6f3d22472e9cf8432bbed03
2010-11-21 16:16:27 -08:00
Joe Onorato
1a542c7b8e The CHEEK_TOUCH stuff never worked. Remove it.
Bug: 3104906
Change-Id: Ia37236ba1775fc3ec8c111e2e0b85b105e0dea6a
2010-11-08 13:02:58 -08:00
Joe Onorato
4058ba0526 Allow both contentIntent and setOnClickPendingIntent in notifications
From the app developer's request:

  Intents assigned to specific views should take precedence over the content intent, but it should not
  be required to set the content intent to null in order for the view-intents to work

Bug: 3107945
Change-Id: Ic5282d441277a9a8c8c700ef3f43872f3405b58a
2010-10-31 11:38:04 -07:00
Daniel Sandler
b0cc50de14 Notification flyovers.
Hold your finger on an individual notification icon to
quickly show that notification's payload.

Also: Quickly swipe up on any icon to open the tray.

Bug: 2994009

Change-Id: I2ae2b546fcfa62994b63b9376f487289b2d06796
2010-10-29 13:33:24 -04:00
Joe Onorato
184498ce5a Allow notifications to not specify a contentIntent.
If they don't, the click events will be passed through to the individual
views in the notification view, which may have their own PendingIntents
attached.

Previously, it was against the UX spec to allow this, but now we are
changing that and will have buttons in there.

Change-Id: I674234212f64b2b8802a0708b7eed0614e147ca3
2010-10-13 17:29:26 -07:00
Jason Chen
39b4867d48 Revert "Merge "Allow notifications to not specify a contentIntent.""
This reverts commit 8885321046622d6a8c0a4214af98dc27eecd48a0, reversing
changes made to 61b8aaadd742f0be708cd37971d2c9e822bf778a.
2010-10-08 16:22:53 -07:00
Joe Onorato
80a752c537 Allow notifications to not specify a contentIntent.
If they don't, the click events will be passed through to the individual
views in the notification view, which may have their own PendingIntents
attached.

Previously, it was against the UX spec to allow this, but now we are
changing that and will have buttons in there.

Change-Id: Ie3b2e96c6a1c4449fa86ed571f3ad0f047320d31
2010-10-08 17:57:18 -04:00
Joe Onorato
2cddeb4b82 am 2c164747: am f7872780: Merge "PowerManagerService needs yet another flag..." into gingerbread
Merge commit '2c164747d364c3e51964d03ecefc5752c7c0c6ba'

* commit '2c164747d364c3e51964d03ecefc5752c7c0c6ba':
  PowerManagerService needs yet another flag...
2010-10-07 12:22:03 -07:00
Joe Onorato
2c164747d3 am f7872780: Merge "PowerManagerService needs yet another flag..." into gingerbread
Merge commit 'f7872780ca3dae9584251b1e3495aed12110254c' into gingerbread-plus-aosp

* commit 'f7872780ca3dae9584251b1e3495aed12110254c':
  PowerManagerService needs yet another flag...
2010-10-05 14:45:28 -07:00
Joe Onorato
8274a0e536 PowerManagerService needs yet another flag...
... to make sure that if you press the power button to turn off the
screen, that the prox sensor won't turn it back on.

Bug: 3011618
Change-Id: Id16c1d65417539d4592f485b1c3efb737540c3cd
2010-10-05 17:39:01 -04:00
Joe Onorato
066b5c5166 manual merge Merge commit '77e42376' into work
Conflicts:
	packages/SystemUI/res/values/colors.xml
	packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java

Change-Id: I891c8a9f6410037ca7805507e85a17f1655c115e
2010-10-05 12:37:03 -04:00
Joe Onorato
77e4237682 am 87efbbb5: Merge "implement the number bubbles on the status bar" into gingerbread
Merge commit '87efbbb563ef96a74ffd2fbbe5c0865a450254df' into gingerbread-plus-aosp

* commit '87efbbb563ef96a74ffd2fbbe5c0865a450254df':
  implement the number bubbles on the status bar
2010-10-04 14:44:40 -07:00
Joe Onorato
6c01a11a20 implement the number bubbles on the status bar
Bug: 2993482
Change-Id: I73b1f8c39e995fd4f986c25ea04127eb23c3cd07
2010-10-04 17:40:24 -04:00
Joe Onorato
7ebd659dbf Merge commit 'f9f9e248' into manualmerge
Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
	tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java

Change-Id: Ibbb2fec2d8c6f5d41398272753d271dfae698100
2010-09-27 14:13:46 -07:00