Commit Graph

67 Commits

Author SHA1 Message Date
Jason Monk
e06b065f6e Fix QS edit state being out of sync
Do this by making SignalCallbacks send out initial state immediately
rather than posting this state.  This requires a little refactoring
to how SignalControllers work.

Bug: 27061469
Change-Id: Iba6b91a4a5d1d13cce0f0d308b6f85f0340bff39
2016-03-02 16:35:27 -05:00
Jason Monk
46dbfb475f Handle density changes in QS
Bug: 26845796
Change-Id: Icc783c9d706382e553df49f699aaf44aac943d18
2016-03-01 11:08:19 -05:00
Jason Monk
f6a3cf9291 Add tests for TouchAnimator
Also fix existing tests

Bug: 27392084
Change-Id: I70299512e8fa3e0cb86c868b47df7703e04d6084
2016-02-29 13:01:08 -05:00
Adrian Roos
4cc2a58ed2 Fix duplicate eventlogtags warnings
Moves the protos and event log tags into a library,
so the build system doesn't think they're duplicates.

Bug: 27151225
Change-Id: Ic96b6b811d4813a4c48940081ea77b12fb23f0bc
2016-02-25 09:28:13 -08:00
Jason Monk
34a5cef629 Let SysUI watch TileService's dialog lifecycle
That way it can better handle tokens and service binding.

Change-Id: I9b882181ecbe52a65e731a2c45f1d296315884b4
2016-02-01 15:04:29 +00:00
Xiaohui Chen
e9dab0dade DO NOT MERGE sysui: remove shelf
Bug: 26742568
Change-Id: I36bd013c4adb62b76b6f2789aa490c1484a535d7
2016-01-26 11:31:51 -08:00
Jason Monk
f668d7cceb Support data usage changes in Settings
Change-Id: I78c6a3956e7136c3ed64d9323d3fe74df2898c5d
2016-01-16 11:18:59 -05:00
Jason Monk
561e219033 Merge "Round out the QS API" 2016-01-13 19:07:33 +00:00
Jason Monk
5bdfd8c126 Get data type from service state as well am: 67b2c16a9a am: 05130f3f23
am: 8ced692e44

* commit '8ced692e445526a74d51391f2c7c30bd43322d46':
  Get data type from service state as well
2016-01-13 18:46:13 +00:00
Jason Monk
9429513cc3 Round out the QS API
- Add startActivityAndCollapse, to make collapsing the shade easy
 - Add isSecure()
 - Add isLocked()
 - Add unlockandRun(Runnable)
 - Add unavailable, active, and inactive states

The states are added to allow consistent UI across OEM devices, by
allowing UI tweaking and tinting to match system tiles with custom
ones.

The combination of isSecure() and isLocked() and unlockAndRun(Runnable)
allows all combinations of launching show when lockend and triggering
an unlock when needed for sensitive tiles.

Change-Id: Iade98ad9f2c22aa174e62090d8ccd44c86f3bb3c
2016-01-12 17:27:52 -05:00
Jason Monk
67b2c16a9a Get data type from service state as well
Bug: 26276354
Bug: 26413831
Change-Id: Ic080300db7d5e5200caf611cc2ee1ef3af93736e
2016-01-12 10:24:09 -05:00
Jason Monk
66c89c15a0 Add API for System QS tiles to set status icons
Allow system apps that have a Quick Settings tile to show a
status bar icon.  If the quick settings tile is removed, the
status bar icon will no longer be shown.

Change-Id: I875b962bbdf4ff863012de688a3dd29a8d7e11ab
2016-01-08 08:54:13 -05:00
Jason Monk
fe8f6826ce More QS Tile modes in the API
Allow tiles to request when they are bound instead of doing it
automatically for them when in the listening state.  Only one
of these modes is allowed for a given tile, meaning it can either
push updates when it thinks they matter, or it can be told when
to update.

Change-Id: I165b39dddb836df90d253aeb5ebea48e62ea0dae
2016-01-05 11:08:05 -05:00
Jason Monk
d5a204f16e Better service management for QS 3rd party tiles
Better wrapper around the service that will handle rebinding
when it dies, binding when it becomes available, and forwarding
along all messages to the service once it binds.

Also better handling of too many services at a time.  Will only
ever bind to at most 3 tiles and will manage which ones are most
important to show based on pending clicks, last update, etc.

Change-Id: I5f4da0bc751f7eb25baa32e5c0bb9f1bc418f5bb
2016-01-04 14:46:11 -05:00
Jason Monk
46c4a32ed9 Fix build
Change-Id: Ib784f3b8e1f8e5166128a86d07b43859ee803765
2015-11-18 10:40:34 -05:00
Jason Monk
4cf95aef83 Move some stuff to SettingsLib to use for Settings Home
Change-Id: Id903747069fe83a896132714e580b1a1d7ee895c
2015-11-18 10:06:54 -05:00
Winson
190fe3bf88 Refactoring secondary user recents logic.
- Removing old broadcasts in favor of direct aidl interface between
  system and secondary users.  Also moving user specific implementation
  into RecentsImpl, allowing Recents to handle proxying between users.

Change-Id: I4bd5ef1d1ee47309b7c754f50a5e8b2e2aab988f
2015-10-22 12:26:21 -07:00
Vadim Tryshev
4b1542a451 Fix accessibility labels for app icons.
Derive the app labels in a right way.
Not forgetting to get accessibility labels for newly dragged-in apps.

The change adds inefficiency with apps getting repeatedly resolved several times,
which is OK for a prototype, but I have plans to optimize this.

Bug: 20024603
Change-Id: I755d38de34c016d0ec31ecc617f7accfd876693b
2015-09-17 11:13:20 -07:00
Vadim Tryshev
4dc0c15a6a Making sure that after a rotation Shelf shows latest set of pinned apps.
2 copies of NavigationBarApps (for vertical and for horizontal orientation) share a single
static copy of NavigationBarsAppsModel.
If the active orientation's view made changes, they are not conveyed
to the inactive one, and if we rotate to show the other view, it will show
stale data.

The fix introduces an event generated by the model, which allows the invisible
shelf to get updated when the visible one makes changes.

Bug: 20024603
Change-Id: I0d749dbac700857b081bce8a5a232f24ba271b25
2015-09-16 16:11:53 -07:00
Vadim Tryshev
8786f3cfa8 Clarifying and stabilizing drag & drop
The existing Shelf DND crashes if profile or app removal happens
while dragging from outside of shelf. This is because in this case
shelf temporary adds a null placeholder enter to the model, and
doesn’t check for nulls in user-removed and app-removed callbacks.

Adding checking for nulls.
In addition, since adding nulls muds the contract between the
shelf view and its model, I’m getting rid of adding null entries
to the model. Nulls are used on the view side, but never leak to
the model.

Because of that, the state of the view (which may have nulls) and the
mode may not match each other during the drag, I introduce storing
app data in views, as a tag. Null tag means a drag placeholder.

Now that the state of the model doesn’t always follow the state
of the shelf via add/remove operations, it makes sense to introduce
set-all/get-all calls in the model, instead of add/remove/get(i)
calls.

Again, all these changes, even though relatively massive, add clarity
into the view/model contract by eliminating strange states where the
model can have nulls in certain positions.

Also fixing a case when removing an app while dragging it happily
creates an icon.

Bug: 20024603
Change-Id: Ie4e617ccf9278708d64ee100265a4858d1227aed
2015-08-28 11:57:17 -07:00
Vadim Tryshev
2e8c5bfd6d Adding more checks for apps coming from saved prefs and from DND.
Bug: 20024603
Change-Id: Icb17c4adb55856e027a0443e19c7147c36bc37f4
2015-08-26 15:45:00 -07:00
Vadim Tryshev
39810767b0 Using actual users in more places.
Fixing an issue when installed apps in Guest user were treated incorrectly.
This happened because we used APIs using the systemui current user (0),
not the app's user.

Also, switching AppInfo from user's serial numbers to UserHandle. Earlier,
I declared that user ids (not serials) is the "lingua franca" between different classes,
so, this move is along these lines. In addition, this is simply more convenient.

Bug: 20024603
Change-Id: I749d900aa17083a41e4215c6587ae5ccaa31f5eb
2015-08-24 18:05:31 -07:00
Vadim Tryshev
1bec0c472b Checking for unlauncheable apps.
When loading apps from prefs, detecting apps that cannot
be launched (for example, were uninstalled) and not adding them
to the shelf.

Also watching for apps that become unlauncheable while the shelf
is shown, and removing them as it happens.

Bug: 22694757
Change-Id: Iab9494f0480e9bf4438b72a94041002be010334f
2015-08-19 15:06:56 -07:00
Vadim Tryshev
e983fd88b4 Eliminating “-1” user serial numbers.
These users required special treatment and complicated code development.

Now simply always using the actual value.

Bug: 22609426
Change-Id: Ife44de442de455248ae7a8ebf8655ddbc4c289d4
2015-08-12 16:57:55 -07:00
Vadim Tryshev
94d469bba4 Adding multiuser support to the shelf.
All users are stored in same SharedPreferences file. User serial number is included in the preference key.

Prefs for deleted users get cleaned up upon switching to a new user.

Bug: 22853745, 22609426
Change-Id: I7f774483bc660ed5b1e8115da9b468a291488723
2015-08-05 12:12:13 -07:00
Jason Monk
810796ca6a am 3bc1702c: am da808d29: am 3623f314: am ea0ad979: am fbcbad13: Merge "Add sizes to SysUI tests" into mnc-dev
* commit '3bc1702c1a789fd490e815916ce6b2df43b7002b':
  Add sizes to SysUI tests
2015-07-29 02:10:43 +00:00
Vadim Tryshev
c5f860cea0 Storing and using user id for pinned shelf apps.
We need this to differentiate between starting apps for the primary and
managed users.

This in particular solves the issue when apps were executed as Owner
while we are in Guest account (see the bug).

Valid user ids for a shelf app are either primary or a managed (work)
user for the profile.
Launcher allows mixing apps for for primary and the managed users on
its home screen. Apps for the managed user are marked with a suitcase
badge.

Launcher includes a user id in the drag and drop info that it sends to
SystemUI, as “profile” extra added to the intent.

Shelf now stores this user id and uses it to start apps.

Bug: 22609426
Change-Id: Id4c6c1ac8617a83f4484f78db578955699d1a888
2015-07-28 07:34:32 -07:00
Jason Monk
e427cb8076 Add sizes to SysUI tests
Change-Id: I27e4a60e2658d3a5db32cdeb73bd0a031865ce86
2015-07-28 10:06:01 -04:00
Jason Monk
3e946a212f am 17127a3c: am 184044e4: am 42caf399: am e648ccbb: am 157ad64d: Merge "Fix emergency only when no sims" into mnc-dev
* commit '17127a3cb603876223949f4475bdc94a2a782b85':
  Fix emergency only when no sims
2015-07-24 05:15:15 +00:00
Jason Monk
b0808aab0c Fix emergency only when no sims
Need to look at a ServiceState to determine if we are actually in
a emergency only state.

Bug: 22619451
Change-Id: I06a2a6fab85ed2ce41d8f7cbb98a1f169ec61b33
2015-07-23 14:20:18 -04:00
Jason Monk
be79896435 am d2fb90f4: am f4b54d2d: am eddcee21: am 5ef8188f: am 58599104: Merge "Remove data icon for WFC" into mnc-dev
* commit 'd2fb90f47ecf9a07cccca5865683b3ac4f469af1':
  Remove data icon for WFC
2015-07-09 20:10:20 +00:00
Jason Monk
e9a12c2476 am 18b2242d: am f98efaeb: am 6f85d1f5: am de5df114: am 8969817a: Merge "Fix roaming icon when not default signal" into mnc-dev
* commit '18b2242d01363e8f03ba420d5ed8e155c361759e':
  Fix roaming icon when not default signal
2015-07-09 20:10:13 +00:00
Jason Monk
5859910463 Merge "Remove data icon for WFC" into mnc-dev 2015-07-09 18:55:06 +00:00
Jason Monk
7150d7fa35 Remove data icon for WFC
Bug: 22095746
Change-Id: I0ca8420c2d88425cbb6da5fcc02c083355e933e9
2015-07-09 10:14:12 -04:00
Jason Monk
61633f1861 Fix roaming icon when not default signal
Bug: 22183802
Change-Id: I0d38f23d81b79e53e3d92db8c6f6a1455a94da4c
2015-07-08 14:19:25 -04:00
James Cook
bd8b81717b Persist navbar app icon list to disk
The icon list is stored in SharedPreferences under
com.android.systemui.navbarapps.

* Introduced a separate data model class for the navbar app list
* All icons are now loaded from PackageManager, not from LauncherApps
* Added test for NavigationBarAppsModel

Bug: 20024603
Change-Id: I0eb3b9e927d3311818096cfd484d6f5a81acbbc7
2015-07-07 22:50:32 +00:00
Jason Monk
c6cc6266c9 Fix EmergencyCallback in NetworkController
- Do some cleanup so that things are more testable
 - Test emergency callback since its possible
 - Fix emergency callback in no sims case

Bug: 16218652
Change-Id: Ic859eff732cc11c5ae8aa6ced3584905bbe215c7
2015-06-11 11:10:15 -04:00
Andrew Flynn
55fc8004ad Show Carrier Network Change icon SysUI even while connected
Taking connect/disconnect events into accounts results in frequent jank
while trying to show the icon.

Bug: 21504588
Change-Id: If271980cc46cfc20f80083de17a4b57c42439069
2015-06-02 12:41:53 -04:00
Andrew Flynn
2fdbe12820 Remove separate light/dark animated vector drawables
Now that AnimatedVectorDrawables can use themed animations, SysUI no longer
needs to track separate AVDs for the carrier network change icons.

Bug: 21118142
Change-Id: Ifb6d7b5e7e3de85c10bc13183b4142fd2e6714b6
2015-06-01 16:45:41 -04:00
Jason Monk
33f8ae7543 Show data icon when appropriate.
Show it in the status bar when its a default network, but always show
it in QS when its connected, so that users can know its connected.

Also fix the tests.

Bug: 18776546
Change-Id: I553588fc6850b0c2ef6e6015b313222bf4c786e7
2015-05-18 11:49:24 -04:00
Jason Monk
07b75fe65d Move NetworkController broadcasts/listeners to BG
Also do some refactoring to avoid having to sets of callback interfaces
with 75% of the same data.

Bug: 19520495
Change-Id: Ife1c71174c0d6a21f924f7de3cb2f97a04c3d5a1
2015-05-18 11:31:49 -04:00
Pavel Zhamaitsiak
5504d39b7f WiFi Calling: Show different operator name string in Data usage dialog.
Bug: 19950657
Change-Id: I9999d58e78154ed2d6d824973c40011875de15ef
(cherry picked from lmp-mr1-wfc-dev)
2015-05-05 13:59:28 -07:00
Andrew Flynn
ae499d19eb Merge "SystemUI Carrier Network Change unit tests" into mnc-dev 2015-05-04 14:43:20 +00:00
Andrew Flynn
5e75147806 SystemUI Carrier Network Change unit tests
- Includes unit tests for verifying mobile data indicators.
- Found one bug where dark mode icon wasn't showing properly when
  different from light mode icon.
- Comment out failing test
  NetworkControllerSignalTest#testSetCurrentSubscriptions

Bug: 20288155
Change-Id: Ib3c9ba224c4187cab35d6bfa68f6bd4c489cf98e
2015-05-04 10:25:09 -04:00
Lorenzo Colitti
d46bb58fa6 Add a status bar icon for Ethernet.
Bug: 20613953
Change-Id: I52970b4f5fb6429876d1a2eb195a834c9e020021
2015-05-02 10:43:31 +09:00
Andrew Flynn
a478d70a68 SysUI: Carrier Network Change icon
- Listen for new PhoneStateListener.CARRIER_NETWORK_CHANGE events.
- Show/hide a new unique animated icon in status bar and quick settings during
  Carrier Network Change events if we are instructed by PhoneStateListener
  and it's during a period without connectivity.
- ObjectAnimator doesn't let you animate colors between themed colors, so
  there's quite a bit of boilerplate duplication in the animation xml.
- Add a new demo mode command to toggle it on/off.

Change-Id: Ic5bb2aa7444303c6b7f2456526a9c25325c6e1f4
2015-04-16 08:37:43 -04:00
Selim Cinek
b8f09cf553 Integrate Heads-up notifications into the shade
Change-Id: I4ca0fb4e76e7c974490538c168da0564fe97e0ae
2015-04-15 12:32:00 -07:00
Jason Monk
baeb0dfccc Merge "Up the history on SignalControllers" 2015-02-17 15:25:35 +00:00
Jason Monk
7f9623f3dc Up the history on SignalControllers
Also add a test for it, because despite the comment next to it, I
try to set it to an invalid value...

Bug: 19201696
Change-Id: I3c12c871c73ad5ab15f39a6b91b29c71101adad6
2015-02-11 09:03:02 -05:00
Chris Wren
930eccaf44 Don't let the heads up close too quickly.
The public API of HeadsUpNotificaitonView was not well suited to the
new requirements, so it changed slightly.

Old API:
 - showNotification: show or update a notification
 - clear: close the window and forget the notification
 - release: send the notification to the shade and forget about it.
 - releaseAndClose: release and close the window
 - dismiss: clear the notification if clearable, or release it

New API:
 - showNotification: show a new notification
 - updateNotification: show a new version of the same notification
 - removeNotification: respond to a cancel
 - release: send the notification to the shade at some point
 - releaseImmediately: send the notification to the shade right now

The new API makes updating vs. posting and removing vs. releasing more explicit.

There is a new internal concept: lingering.  The heads up lingers
after an event that would have closed it if the minimum visibility
time has not been satisfied. In the case that the notification was
deleted, the heads up may be visible, but mHeadsUp will be null.  In
this case, touches on the notification views are disabled.

More responsibility for control of the heads of policy was moved into
the HeadsUpNotificaitonView class. This should continue on master.

Some changes to support testing.

Added a test to cover all the edge cases for minimum visibility time:
 1. extend visibility when canceled too soon
 2. extend when updated with a low-priority version, fast update.
 3. extend when updated with a low-priority version, slow update.
 4. don't extend the visibility in any other case

TODO: Policy parts of HeadsUpNotificationView should be split out
into a separate HeadsUpNotificationPolicy class, and even more of the
policy should be lifted from status bar that new class.

Bug: 17878008
Change-Id: I192419d0685dd022ee7edcd792e346a4f39c6adb
2015-02-04 17:16:16 -05:00