Commit Graph

39 Commits

Author SHA1 Message Date
Jason Monk
49fa016a98 Move navigation bar logic to its own class
Start hacking away at PhoneStatusBar by trying to pull out
as much NavigationBar logic as possible.

Test: runtest systemui
Change-Id: I23b904428be31b91f0747fd60c9f6e0dd323eb44
2017-01-17 10:31:13 -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
Jason Monk
b5b0920170 Allow CommandQueue to have multiple callbacks
Allow for multiple callbacks to be added to CommandQueue.
This will allow PhoneStatusBar to be broken up into pieces
that make more sense.

Test: runtest systemui
Change-Id: I73a7da1c23c8e45a291e5957e7341f3930abc334
2017-01-09 12:51:56 -05: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
3713151425 Merge changes I52007c69,I6503947e,Icf677f4a,I2ae7ed61
* changes:
  Unit testing for fragments.
  Plugin fragment support
  Move QS to a fragment
  Fragments in SysUI!
2016-11-11 16:38:57 +00:00
Jason Monk
bbac121e44 Fragments in SysUI!
Add system to add fragments to sysui windows for better code
modularity and testability.

Bug: 32609190
Test: Manual
Change-Id: I2ae7ed6133aff3fc5cdbdb3ec89d55183b7ac797
2016-11-11 11:19:15 -05:00
Jason Monk
97a06a12ed Add switchable theme to tuner
Allows option in tuner to switch between system theme overlays
if multiple exist. Requires a restart to take effect.

Test: Settings -> Tuner -> Other -> Theme
Change-Id: Iea43b9cbb67fd91c6008be594ad4cfd19c3f57ec
2016-11-11 09:01:20 -05:00
Winson
73bc159dcc Adding PIP logic for phones.
- Adding basic behavior to move PIP window and launch back into
  fullscreen, as well as drag it to dismiss.

Test: Deferring CTS tests as this interaction is only temporary and not
      final

Change-Id: I5272a045090c20c45b345813d10dc385c3f83221
2016-10-24 11:31:07 -07:00
Jorim Jaggi
c3fe204780 More latency tests (1/2)
- Move latency fake actions into a central location, LatencyTester
- Add latency test for screen turning on

Change-Id: I8aa3f475d56a4ee7a36b97bd6ece32e60c5851cd
2016-10-07 18:54:21 +02:00
Jason Monk
fcdcf7f636 Merge "Plugins for sysui" 2016-09-19 16:54:12 +00:00
dooyoung.hwang
279c334633 Merge "Fix issue that Overview key doesn't work at secondary user" am: 5379f47d85 am: da9a9da520
am: 983f30a5a4

Change-Id: Ide8c2612c6cbf276eb72a2fc3957965656d6e1d5
2016-09-09 22:02:58 +00:00
dooyoung.hwang
b647984f04 Fix issue that Overview key doesn't work at secondary user
If user captures screenshot, screenshot process is started. Screenshot
process also starts services that is defined SERVICES_PER_USER.
As a result Recents class's object is unexpectedly constucted from
screenshot process, and cause to connect with system-user's SystemUI
with mUserToSystemServiceConnection. So, binder proxy from system-user's
SystemUI to secondary-user's SystemUI is replaced with proxy to
screenshot process. In this case Overview key doesn't work at all
until reboot.

Bug:30340532
Change-Id: I84b8b4a02ac3ff781e06d57be19cff56efa76521
2016-09-07 16:03:17 +00:00
Jason Monk
86bc331889 Plugins for sysui
Why this is safe:
 - To never ever be used in production code, simply for rapid
   prototyping (multiple checks in place)
 - Guarded by signature level permission checks, so only matching
   signed code will be used
 - Any crashing plugins are auto-disabled and sysui is allowed
   to continue in peace

Now on to what it actually does.  Plugins are separate APKs that
are expected to implement interfaces provided by SystemUI.  Their
code is dynamically loaded into the SysUI process which can allow
for multiple prototypes to be created and run on a single android
build.

-------

PluginLifecycle:

plugin.onCreate(Context sysuiContext, Context pluginContext);
 --- This is always called before any other calls

pluginListener.onPluginConnected(Plugin p);
 --- This lets the plugin hook know that a plugin is now connected.

** Any other calls back and forth between sysui/plugin **

pluginListener.onPluginDisconnected(Plugin p);
 --- Lets the plugin hook know that it should stop interacting with
     this plugin and drop all references to it.

plugin.onDestroy();
 --- Finally the plugin can perform any cleanup to ensure that its not
     leaking into the SysUI process.

Any time a plugin APK is updated the plugin is destroyed and recreated
to load the new code/resources.

-------

Creating plugin hooks:

To create a plugin hook, first create an interface in
frameworks/base/packages/SystemUI/plugin that extends Plugin.
Include in it any hooks you want to be able to call into from
sysui and create callback interfaces for anything you need to
pass through into the plugin.

Then to attach to any plugins simply add a plugin listener and
onPluginConnected will get called whenever new plugins are installed,
updated, or enabled.  Like this example from SystemUIApplication:

PluginManager.getInstance(this).addPluginListener(OverlayPlugin.COMPONENT,
        new PluginListener<OverlayPlugin>() {
    @Override
    public void onPluginConnected(OverlayPlugin plugin) {
        PhoneStatusBar phoneStatusBar = getComponent(PhoneStatusBar.class);
        if (phoneStatusBar != null) {
            plugin.setup(phoneStatusBar.getStatusBarWindow(),
                    phoneStatusBar.getNavigationBarView());
        }
    }
}, OverlayPlugin.VERSION, true /* Allow multiple plugins */);

Note the VERSION included here.  Any time incompatible changes in the
interface are made, this version should be changed to ensure old plugins
aren't accidentally loaded.  Since the plugin library is provided by
SystemUI, default implementations can be added for new methods to avoid
version changes when possible.

-------

Implementing a Plugin:

See the ExamplePlugin for an example Android.mk on how to compile
a plugin.  Note that SystemUILib is not static for plugins, its classes
are provided by SystemUI.

Plugin security is based around a signature permission, so plugins must
hold the following permission in their manifest.

<uses-permission android:name="com.android.systemui.permission.PLUGIN" />

A plugin is found through a querying for services, so to let SysUI know
about it, create a service with a name that points at your implementation
of the plugin interface with the action accompanying it:

<service android:name=".TestOverlayPlugin">
    <intent-filter>
        <action android:name="com.android.systemui.action.PLUGIN_COMPONENT" />
    </intent-filter>
</service>

Change-Id: I42c573a94907ca7a2eaacbb0a44614d49b8fc26f
2016-09-02 11:33:22 -04:00
Adrian Roos
40ea083b59 Add way to set live wallpaper across users
Also adds an entry point for vendor specific services
to SystemUI.

Bug: 30038484
Change-Id: I8f335c1f7de15d619f2c688a8ac95372f166595f
2016-07-15 11:20:36 -07:00
Jaewan Kim
6a29c3e14f PIP: Fix crash in Recents when restrict profile is enabled
Bug: 28071518
Change-Id: I293f4e872990cca051c3395d2a51c2df59d71227
2016-04-12 18:07:07 +09:00
Winson
3c2c34bb03 Workaround to ensure that a SystemUI process is always available.
- For a non-primary user, this CL will ensure that the SystemUI process
  is started when we are switched to the user.  This allows us to
  maintain our current user-management model for Recents, which depends
  on this process for preloading and state management.

Bug: 27175589
Change-Id: Id985fc2876e6daf06f303b44c0f9d1d3fd377842
2016-04-05 15:54:59 -07:00
Muyuan Li
94ce94e960 Allows components to register shortcut key.
The registered shortcut will be called from PhoneWindowManager,
before dispatching

Change-Id: If26128939b45a639c8895719a7a23ca433f39fd9
(cherry picked from commit 4da863c5a8872dcabb179a978a2b2157d9081679)
2016-02-26 22:30:34 +00:00
Youngsang Cho
f164792472 Initial check-in of picture-in-picture system-ui
Bug: 26549507
Change-Id: I6c69b5e2b5492858fc997657b5a06d3e50ca16e3
2016-01-15 15:27:13 -08:00
Xiyuan Xia
1b30f79cff Refactoring for better extendability
- Exposing members of PhoneStatusBar, StatusBarKeyguardViewManager and
  KeyguardBouncer to sub class;
- Add a configuable SystemUIFactory as class factory for components;
- Add logoutCurrentUser and switchToByUserId to UserSwitcherController;

BUG:22407003
Change-Id: I3902baf3c721d89217b27a6310c4202a198cb209
2016-01-14 09:47:57 -08:00
Jorim Jaggi
dd98d41e3a Add gesture to drag in recents from navigation bar
Change-Id: I672ed08f1019835891411b87e2d0de0290defff7
2015-11-19 14:10:28 -08:00
Jorim Jaggi
1fcbab6ae5 Implement divider UX interactions
- Update visuals to spec
- Divider lifts when touching
- Implement basic version of snap points and animations
- Implement touch conflict behavior: If touched around 48x48dp
area around the handle, the divider handles all these touches.
If touched outside of the black background divider, touch goes
directly to underlying window. If touch on the black background
divider, touch is considered slippery and thus the window in
which the touch trace moves gets the touches.

Change-Id: I0307c191ae032672c4b73d439c23cf9833d3fce6
2015-11-06 16:17:57 +01:00
Jorim Jaggi
61f39a7b98 Migrate docked divider drawing to SysUI
Move docked divider drawing to SysUI. This let's us have real
time shadows in the future. Keep DockedStackDividerController
for placing/visibility in window manager.

Change-Id: I82c10add626d30f2ba180ee2a21cdbe6ddfe0371
2015-11-06 16:13:11 +01:00
Michael Wright
244f776855 resolve merge conflicts of f013c3f111 to master.
Change-Id: I2045187f8fa948a1733cb9a2cdc0a69ae97b5907
2015-10-20 23:48:55 +01:00
Michael Wright
9209c9cd9a Add SystemUI component to watch for keyboard attachment.
Add a new SystemUI component to watch for keyboard attachment /
detachment. If the config specifies the name of a keyboard that is
packaged with the device, then SystemUI will ask the user if they
would like to enable BT (if disabled) and then attempt to pair to the
device.

Bug: 22876536
Change-Id: I786db35524d49706d5e61d8b8bc71194d50113f3
2015-10-12 15:21:37 +01:00
Winson
94a148594d Fixing crash in configuration change for secondary users.
- The crash is a regression caused by ag/773159.
2015-09-23 19:51:16 +00:00
Winson
fe67abac68 Allow SystemUI components to be started for non-system users.
- Certain SystemUI components require initialization per-user, so this
  CL allows us to selectively start those components when SystemUI is 
  restarted for each user, and also lets us remove some extra workaround
  code in Recents to handle this case.
2015-09-22 21:13:52 +00:00
Jason Monk
5e745172d9 Setup service for tunable things to use.
Change-Id: I13daa68d3d1ec5584fd84f356f4f5a0d1c0b853a
2015-06-07 08:44:14 -04:00
Jorim Jaggi
d61f2271c4 Remove dead code #6: Delete old recents implementation
Change-Id: I93b1257563d6352a54141bd4c90d2d4587782fd2
2015-01-07 15:20:13 +01:00
Alan Viverette
5a399490c2 Use activity for brightness dialog
Also fixes brightness controller failure to unregister callbacks.

BUG: 15512088
Change-Id: Ia665e006d93391d5a66d4ace614660c4e6d2d5b5
2014-07-14 16:20:40 -07:00
John Spurlock
8600534df6 VolumeZen: combine ringer/notification volume and zen.
- Implement a new volume panel widget, combining volume and
  zen mode + conditions.
- Show zen mode + conditions when modifying ringer or notification
  streams.
- Host the volume panel widget in a dialog when being controlled
  by the audio service / volume keys.
- Remove support for multiple sliders in the volume panel.
- Remove support for separate ringer + notification volumes
  in the volume panel.
- Move volume panel resources up to SystemUI.
- Create a new combined Notifications quick settings tile.
- Host the volume panel widget in the quick settings panel under
  Notifications.
- When the quick settings detail panel is visible, route the volume
  keys to the embedded widget instead of showing a redundant dialog.
- Create common styles for quick settings text to be closer to spec.
- Update the framework resources for the ringer stream.
- Show the ringer icons in global actions.
- Add "until you turn this off" back as a separate zen condition.
- Disable time condition buttons when they are N/A.
- Don't allow volume changes to set ringer mode silent.

Bug:15186070
Change-Id: Id5e321dd1d5e7c4cf3917027ffbdf7e80d38b00d
2014-05-27 10:08:00 -04:00
John Spurlock
3346a80208 VolumeZen: SystemUI now hosts the volume dialog.
- Allow SystemUI to set the volume controller interface using
  a new binder call to audio service.
- Remove VolumePanel's dependency on AudioService.
- Host the base VolumePanel in the SystemUI process.

Change-Id: I095d5a1a579d42b68d0f81abb4087bd0c754b876
2014-05-21 09:58:41 -04:00
Dianne Hackborn
d83a096f29 Bump up priority of system receiving BOOT_COMPLETED.
Change-Id: I5166f88f11f781914312e867cb653c8ecbefa705
2014-05-02 16:29:10 -07:00
Dan Sandler
dc5f16bf09 Avoid sending broadcasts before BOOT_COMPLETED.
SystemUI instances can now take advantage of a new lifecycle
callback, onBootCompleted(), to avoid jumping the gun.

Bug: 14092537
Change-Id: I3f7db7a4753f874c4d75235f263c2bd374debec4
2014-04-22 11:51:42 -04:00
Adrian Roos
070a0b61cd Set a dark theme for SystemUI.
The default theme for the platform has changed to a
light variant. This puts SystemUI back in the dark.

Bug: 13635952
Change-Id: I230a2078ba6bf5a79c768f0e357fcbd75f283cf8
2014-04-11 01:36:33 +02:00
Jorim Jaggi
3beffdf4a0 Fix crash when taking screenshot.
Start SystemUI services only if needed.

Bug: 13635952
Change-Id: I76a5e3333ed8f51a267e33b2cf172d6c775ac914
2014-04-05 17:06:21 +02:00
Jorim Jaggi
cff0acb6b1 Wait for Keyguard to be drawn after boot.
The old logic with waiting for the Keyguard to be drawn assumed that
it is in an own window, and just checked for the visibility. This is
no longer possible as the Keyguard is in the status bar, and the status
bar might have been drawn without the Keyguard. So we have to wait
explicitely until Keyguard told PhoneWindowManager that it has now been
drawn and we can turn on the screen.

In addition, the starting logic of SystemUI is moved into
SystemUIApplication such the we can make sure that the status bar
already exists when the callbacks from PhoneWindowManager reach
KeyguardService. This simplifies the logic a lot.

Bug: 13635952
Change-Id: Ifd6ba795647edcf3501641e39052e4d04bc826fb
2014-04-02 22:11:19 +02:00
Michael Jurka
80343f646f Fix recents animations for secondary users
Bug: 7361640

Change-Id: Ibd177bf01758fb8706b82dcf3bf234e052c38aa3
2012-10-19 16:50:29 +02:00
Michael Jurka
9bdaada95c Fix bug 7138446: Icon blips in during Recents animation
Add animation where icon and description of the
primary activity fades and translates in

Change-Id: Ie21b5302ac9e58ee6af219b7cde98d12a8e82697
2012-10-02 21:18:26 +02:00
Michael Jurka
cb2522c86d Recents: apps scale down to thumbnails now
As a part of this change, Recents is now an
activity.

Known issues:
* Jank: jump-cut as app icon appears suddenly
  after the aniamtion
* Preloading recents is broken on phones without
  soft nav bar and on tablets
* Thumbnail window from animation lingers/flashes
  sometimes

Change-Id: Ie6f991f3c2e1e67f9ed84eb6adba9174ed957248
2012-08-23 04:53:53 -07:00