59 Commits

Author SHA1 Message Date
Mady Mellor
4c19760b91 Don't offer snooze for foreground service notifications
Also updates NotificationMenuRow tests to actually check if menu
was created.

Test: Manual, have foreground service, check if snooze is visible
Bug: 37152715
Change-Id: I09cf60598c3e8991f2da731da1ef7e0a718c3435
2017-04-10 18:30:27 -07:00
Jason Monk
e645aee45a QS: Add transient icon for hotspot
Will make the loading time more clear.

Test: visual
Bug: 32270851
Change-Id: I0ea7591da132ff65fb7fc16b03b2891891e66598
2017-03-31 13:49:21 -04:00
George Mount
c7146beabe Make public getFragments() and onGetLayoutInflater() methods
Bug 34703669
Test: I846ef668e3dd7d664cfb56d2b9400467ba9b79f4
Change-Id: Ie202960ada86b25e964f98a639b5f5740c8fdb79
2017-03-29 14:58:42 -07:00
TreeHugger Robot
9d421ba050 Merge changes Ia971b2bc,I0001eb3d,I55a6951e
* changes:
  Remove framework-protos from SystemUI
  Disable proguard for PluginDummyLib
  Enable multidex for dx
2017-03-27 23:37:10 +00:00
Mady Mellor
be976024a8 Merge "Add plugin interfaces to control notification menu / swipe behavior" 2017-03-24 16:54:18 +00:00
Colin Cross
6a8a4d8912 Disable proguard for PluginDummyLib
Proguard fails for jars that contain no class files, disable it.

Test: m -j ANDROID_COMPILE_WITH_JACK=false PluginDummyLib
Change-Id: I0001eb3de7b7cea2fa9f91de0c1e59569d41ae8a
2017-03-23 18:08:41 -07:00
Jason Monk
782cd6711b Create plugin interface for volume dialog
Very few logic changes, mostly just breaking out certain interfaces
and classes to the plugin lib.

Test: make + volume keys
Change-Id: Ieabc6d35f6ef980842849236a0b8ffd5543b3a2c
2017-03-24 00:40:25 +00:00
Mady Mellor
95d743c38c Add plugin interfaces to control notification menu / swipe behavior
1) Updates the notification menu plugin to do more:
- The plugin can now supply the view it wants to display behind a
  notification as the menu
- Touch interaction (i.e. notification translating on top) is piped
  through to the plugin so it can update the view behind the notification

2) Makes NotificationMenuRow an implementor of the plugin which moves
   a bunch of that logic out of NotificationStackScroller

Test: runtest systemui
Change-Id: I8723b96c195ff7311317d5523418cfcbe2a79b52
2017-03-22 19:04:50 -07:00
Jason Monk
361915c727 Move global actions to sysui and add plugin interface
- Move default global actions ui to sysui
 - Add fallback legacy interface in case sysui breaks
 - Switch to fallback if sysui dies or isn't responding

Test: Long-press power
Change-Id: I943522611de5dbbee61e66c67cf3a56379091e97
2017-03-22 09:41:34 -04:00
Jason Monk
e5b770e47d Updated QS UI
- Adds footer to QS which contains the date/alarm info
   and all touch targets (settings, edit, etc.)
 - Swaps out emergency + carrier text on cell tile for a
   standard CarrierText from lock screen in the header
   to make the header only contain status info.
 - Add dividing line
 - Work on animations

Test: runtest systemui
Change-Id: I97dfea1b1ea7006b53eb61ac3a1f942c64dd282d
2017-03-04 20:02:09 -05:00
Jason Monk
702e2ebf9f Add plugin API for individual QS tiles
This will allow prototyping of individual QS tiles and/or their
visual representation without having to write a plugin for the
entire panel. This will allow quick iteration on QS UI + dual
target tiles.

Test: Install plugin using new API
Change-Id: I05ca9d9f5a200a1dad2c3582251a36edb5cb9aba
2017-03-04 16:01:26 -05:00
Jason Monk
4eb01a20c4 Fix NavGesture version
Test: make
Change-Id: Ib9925ac5f01d0d08ef7f37222f0e78321753b464
2017-03-02 14:33:47 -05:00
Jason Monk
ec34da8f6f Add method for plugins to reference global dependencies
The new annotation versioning system allows plugins to share common
global interfaces that can be versioned on their own. To facilitate
this add a static method for plugins to get a hold of dependencies.
To get any dependency a plugin must @Requires it so it can be version
checked.

Test: Plugin that uses the new call.
Change-Id: I8e01260f8fbc14465502d506a7aa08212795ad9b
2017-03-01 13:26:01 -05:00
TreeHugger Robot
e4b106b1aa Merge "Fix notification shelf icon showing on top of snooze leave behind" 2017-02-16 18:34:59 +00:00
Jason Monk
d7937b3488 Merge "New system for versioning sysui plugins" 2017-02-15 20:49:05 +00:00
Mady Mellor
434180ce51 Fix notification shelf icon showing on top of snooze leave behind
Also fixes an issue where the guts closed listener would always call
onHeightChanged because the notification isn’t marked as removed
until after the listener gets called.

Fixes: 34866027
Test: Manual - have one notification, snooze it
Change-Id: Ic67bdb353b8bb5df8bdaaf6d3e71ade7da05ee46
2017-02-13 17:04:27 -08:00
Geoffrey Pitsch
df44b606f3 Updated Inline Notification Controls
Removed old xml resources, strings, dimens, etc
Different behavior when sent from the default channel.
Display how many notification categories are used by the app.
Group label when channel is associated with group.
Add package icon.
Fix tap-away-to-save behavior

Test: runtest systemui
Change-Id: Ib41a536a5c4e7c7747a2453eddc3b4b4b99ffa7a
2017-02-10 13:24:54 -05:00
Jason Monk
ca2156890a Fix tinting and sizing of tuner lock screen shortcuts
Test: visual
Change-Id: I13f0281d38cd4d73322e9752d9bca36be2412917
2017-02-09 20:25:20 -08:00
Jason Monk
5bec68fbea New system for versioning sysui plugins
Use annotations to handle the multi-dimensionalness of interface
versions, but still maintain compile time inclusion of current
versions.

Test: runtest systemui
Change-Id: I0789a72112cf6630a6406f76020071c8a6d9e24c
2017-02-09 09:32:20 -08:00
Jason Monk
421a9410b4 SysUI: Add method for plugins to keep status bar full screen
Lots of things detect overlays these days (installing apps) and the
only way to avoid the problems associated with this is to live in
the status bar window. So allow plugins to hold the window open
when they want to so they can have overlays be in that.

Move StatusBarWindowManager to Dependency to make things easier
as well.

Test: Install the example plugin, test can access QS and interact
      with apps

Change-Id: Ib2288bf56704960847217bad01a480ab407e0ffe
2017-02-07 18:58:14 -05:00
Geoffrey Pitsch
580f32d7b0 Merge "SystemUI uses Builder API with NotificationChannel" 2017-02-02 20:25:48 +00:00
Geoffrey Pitsch
1dc93bc407 SystemUI uses Builder API with NotificationChannel
Some changes to channels based on UX feedback.

Test: runtest systemui
Change-Id: I1b2f661ba145d6926035f992231dc3c2f8cbf844
2017-02-02 11:12:05 -05:00
Jason Monk
de850bbcaa Fix leaks in sysui
Add support for testing for PluginManager and TunerService leaks
and add tests for the known leaks and fix them. Also port PluginManager
and TunerService to Dependency to make them easier to handle in
tests.

Test: runtest systemui
Change-Id: I5642539ee24dd72f802905106decd0c87b41b4eb
Fixes: 34846972
2017-02-02 10:58:18 -05:00
Jason Monk
2a6ea9c2a1 Delete BaseStatusBar
It is a relic of a more complex time, but has passed out of all
knowledge for too long.

Test: manual testing on phones and TV
Change-Id: I62a15d9413ea4bda3ac82bf6f7d22c096e2c1cdc
2017-01-26 15:17:45 -05:00
TreeHugger Robot
1ab054bc37 Merge "Add assistant-provided snooze options to snooze menu" 2017-01-26 20:01:32 +00:00
Mady Mellor
754d8226c9 Add assistant-provided snooze options to snooze menu
Test: manual via Assistant app
Change-Id: Ie77181601a20e46774d009c7ecea65e99434ebd3
2017-01-26 18:07:09 +00:00
Dan Sandler
8e032e15e6 Notification Channels come to SystemUI's own notifications.
There are five channels at present:
    ALERTS - low battery etc.
    SCREENSHOTS - progress & result
    SECURITY - notifications hidden due to policy
    STORAGE - disk low
    STATUS - basically everything else

The importance for each channel should match the legacy
priority of the notifications it carries.

Bug: 34250937
Test: runtest systemui
Change-Id: I5915ca453258caea63b0d9bd756893db05e8d600
2017-01-25 23:37:06 -05:00
Mady Mellor
3e6552036e Add snooze listener so that a plugin can snooze a notification
Test: manual
Change-Id: Ieb3c0fcae6d832c3e8f5d1b983c52cf4f2ff6239
2017-01-25 12:34:22 -08:00
Mady Mellor
87d7945f06 Change NotificationGuts to contain a view
NotificationGuts is now given a view to display, the notification
management controls have been moved into their own view.

NotificationGuts is provided a view to show via a MenuItem.

This allows configuration via the NotificationMenuRowProvider Plugin.

Test: manual
Change-Id: I68cb23ea2cada30cc6e930fa8c03e0aa4014dfe2
2017-01-25 12:34:11 -08:00
Mady Mellor
43c2cd1a40 Create + implement plugin for NotificationSettingsIconRow
This will allow plugins to supply additional menu options to the
menu "behind" a notification.

This CL does not include behavior for when one of these new menu
items is tapped, this will be added in a separate CL.

Test: manual
Change-Id: I322f9f39d33b043bd23dcbede5dd15e6afa73fc1
2017-01-25 12:23:29 -08:00
Jason Monk
20ff3f9255 SysUI fragments: Integrate new support for constructing
Use a new system for constructing fragments so they can be swapped
out in place maintaining state. This will allow easier integration
with plugin lifecycle as parents who have child plugin fragments
can depend on the class existing and won't have to listen to
the lifecycle.

Test: runtest systemui
Change-Id: I517f4ce3d114abd49b1b5baca388d19e929b8f90
2017-01-23 16:28:03 -05:00
Jason Monk
9c7844cb91 Work on sysui dependencies
One of the many problems with PhoneStatusBar is that it holds
dependencies for many other parts of SysUI. Fix this by creating
a static method of grabbing dependencies that are global to sysui
this cleans up a lot of chains of interdependence.

Also add easy way to inject mocks of these dependencies for the
purpose of testing.

Test: runtest systemui
Change-Id: Ia0e947faea62d15b665facada47ac9916c99f895
2017-01-23 12:55:53 -05:00
Jason Monk
cd26af7054 Move all time ticks to bg handlers, and post
This will hopefully avoid blaming sysui for ANRs when the system
is hosed.

Test: Manual, build, push, wait for time to change
Change-Id: I1661ac1a997ad8917b449dd175229d8b77f583c9
2017-01-13 13:43:22 -05:00
Jason Monk
59d86ed2a8 Add one-shot plugin support
Should have happened a while ago.

Test: runtest systemui
Change-Id: I0da4deb5c297e8030213810815a408364ec97e14
2017-01-11 11:29:17 -05:00
Chris Wren
5e6c0ffd3e Create a global registry for system message IDs
Port all system UI notifications to use the registry.  Retain stable
integer IDs where they exist. Assign new stable IDs where resource IDs
were previously used.

Using "message" rather than "notification" since we may eventually
want to include dialogs and toasts.

Bug: 32584866
Bug: 30995038
Test: runtest systemui
Change-Id: Iec4d7cebbd88683e339ada29a279315222699942
2017-01-06 09:22:02 -05:00
Jason Monk
26bc8996c8 Add notifications for incorrect plugin versions
Test: runtest systemui
Change-Id: Ic59a583202a8a20fbfc6fb504e6ab60ecc71ce78
2017-01-04 15:57:30 -05:00
Jorim Jaggi
40db029cfe Light navigation bar support (1/2)
Test: Open an app that has this flag set.

Test: android.systemui.cts.LightBarTests

Bug: 29058491
Change-Id: Idaff65fdd5c59b68ae9920726c9ea50b53f96675
2016-12-08 13:52:41 -08:00
Xiaohui Chen
40e978e0d1 sysui: fix navbar button view orientation
Before navbar assumes rotation 0 means portrait and rotation 90
means landscape.  This is not necessarily true, in certain devices
the natural orientation (0) is landscape.  Here we removed that
assumption and make sure we use the right inflater at all times.

Bug: 32516898
Test: Locally on test device
Change-Id: I3db44dcb35d8511fb9d42b147b2bd137ff0750f7
2016-12-02 13:51:49 -08:00
Adrian Roos
f9d13f6d7a Doze: Add plugin hook
Test: mmm vendor/google_experimental/users/roosa/DozePlugin/
Change-Id: I7ea55954f0c07be932e8ee7037e03b7c01cc1108
2016-11-18 15:59:00 -08:00
Jason Monk
f4e019aaad Plugin fragment support
Allows fragments to be easily switched over to plugins and a provides
a convenient base class for plugins to use that makes sure the layout
inflater and context point at the plugin's and not sysui's.

Bug: 32609190
Test: runtest systemui

Change-Id: I6503947e980f66ddcd826f6ca9a92b591ce0eb1e
2016-11-11 11:19:52 -05:00
Jason Monk
0ceef21187 Move QS to a fragment
There is now a bit too much of the view/layout logic touching the
fragment, but sort out that later and get something over to fragments
for now.

Bug: 32609190
Test: Manual
Change-Id: Icf677f4a70e6b92892a0fc27a0e673940ebc7a73
2016-11-11 11:19:16 -05:00
Jason Monk
fe62a154af Don't include the example plugin in mk
It might accidentally get built by mm.

Test: manual
Change-Id: I1be30af36b3c392217cd5d723d19918b0adda22c
2016-11-04 15:31:11 -04:00
Jorim Jaggi
fe762344f4 The big keyguard transition refactor (1/n)
The heart of this change are two things:
1) Instead of using the force hide mechanism to hide windows behind
Keyguard, we actually make the activities invisible in activity manager.
2) When Keyguard is going away, we change the visibilities in activity
manager and run an app transition.

At the very core we move the responsibility of hiding activities to
ActivityStack, which checks whether Keyguard is showing, and then
hides all non-show-when-locked activities. For that, we need to check
whether any window of an activity has SHOW_WHEN_LOCKED set. We
introduce a callback from WM -> AM in case these Keyguard flags have
changed.

Furthermore, we decide whether to occlude Keyguard in KeyguardController,
which just checks whether the top activity has SHOW_WHEN_LOCKED set. When
this state changes, we prepare an occlude/unocclude app transition, and
in PWM we just inform the Keyguard about the animation so SysUI can play
along this animations in a mostly synchronized manner.

Since we now use an app transition when unlocking the phone, we get
lockscreen launch animations for free - window manager automatically
waits until the activity is drawn, or directly executes the transition
if there is nothing to animate. Thus, we can remove all the infrastructure
around "waitingForActivityDrawn".

The logic to show/hide non-app windows is moved to policy, and we add the
ability to run animations on non-app windows when executing an app
transition.

Test:
1) runtest frameworks-services -c com.android.server.wm.AppTransitionTests
2) Manually test unlocking Keyguard:
2a) Without security
2b) With security
2c) With security but trusted
2d) Portrait while activity behind is in landscape
3) Test launching things from Keyguard
3a) Without security
3b) With security
3c) Launch camera without security
3d) Launch camera with security
3e) Launch camera with securtiy and trusted
3f) Launch voice affordance
4) Set no notifications on lockscreen, drag down, make sure you get
the correct animation
5) Test clicking "emergency" on bouncer
5b) Test "Emergency info" on emergency dialer
5c) Test clicking edit button on emergency info, should show pattern on
Keyguard

Bug: 32057734
Change-Id: Icada03cca74d6a612c1f988845f4d4f601087558
2016-11-01 13:53:32 -07:00
Jason Monk
6a652a4442 Make plugins have an application context
So things that use them don't crash.

Test: Plugin that uses getApplicationContext
Change-Id: I8673cb95544280f593479b014cd2620c2d02bf80
2016-10-28 10:14:20 -04:00
Jason Monk
d371f9828b Add system property to not disable plugins on crash
Should be used only during dev to avoid having to turn crashing
plugins back on constantly.

Test: Manual
Change-Id: I2f2a461bf7aef017781ed3b61fcb216d7e1cbae9
2016-10-28 10:14:19 -04:00
Jason Monk
4f70b9cfd4 Faster plugin updating from UI control
Send a broadcast back and forth to speed up the rate at which plugins
are enabled or disabled.

Also update make files to handle exclude tests better.

Test: Manual
Change-Id: Ic8f45c663c3a5e5fd4b3e9e2f79480e155845c14
2016-10-28 10:13:56 -04:00
Jason Monk
3b75827cbf Merge "Add nav gesture plugin interface" 2016-10-20 21:16:20 +00:00
Jason Monk
67e6c80405 Add nav gesture plugin interface
Test: Manual
Change-Id: Ieb61a98cb1921358d41728bdbc7fb0c9c8fa46c1
2016-10-20 14:26:23 -04:00
Jason Monk
96cd7ddcc1 PluginLib: Don't use foreach
For some reason it makes android studio angry when embedding the
plugin lib in it.

Test: runtest systemui
Change-Id: I8c7202846903a75ffcbad86cb31862098e8d939a
2016-10-14 14:39:31 -04:00
Selim Cinek
fbf7dbf78c Fixed build breakage
Build was broken due to refactoring in master
Test: build

Change-Id: Ic455c504bc1dab56da3630073245b8391614f042
2016-10-11 13:08:52 -07:00