24 Commits

Author SHA1 Message Date
Delphine Martin
25fed91371 Fix incorrect syntax in Proguard flags
When writing a rule matching fields and methods at the same
time, only the name '*' is authorized.

Bug: 34916285

Change-Id: I90cb8273f0915e216940faa1b3d9c6e82296798f
2017-02-03 11:47:33 +01: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
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
Yao Chen
634acb9712 Add CarVolumeDialogController in SystemUI for Android Auto.
Cars usually have an external audio module. When Android is serving as
the car's headunit, users should be able to adjust the car's volume
through SystemUI. The following changes are made to make it work:

+ Load VolumeDialogController from SystemUIFactory
+ Added CarSystemUIFactory
+ Added CarVolumeDialogController which extends VolumeDialogController
  and it uses CarAudioManager as source of truth for volume controls.
+ Some refactor in VolumeDialogController to make it easier for
subclasses to override volume controls.

Note that CarAudioManager does not completely replace AudioManager.
Majority of code in VolumeDialogController still applies in the car use
case, so I made CarVolumeDialogController a subclass of
VolumeDialogController instead of making them peers.

Bug: 27595951

Change-Id: Id4adec7281e41aa71f3de034e5b88a32a89be305
2016-04-19 14:50:10 -07:00
Jason Monk
3ebd23943b Nav bar tuner
Allows reorginization of the navigation bar.  First pass.

Change-Id: If546ca5835412d15c05c41ffd5c5aa0857b9417f
2016-01-27 23:03:36 -05: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
Rakesh Iyer
1186faa905 System UI for auto.
This change adds in the beginnings of System UI for
the automotive use case. We extend the Phone status
and navigation bar and override the parts which are
customized for auto.

The navigation bar itself is built from a resource
array specified in car_arrays.xml to allow of ease
of customization of the shortcuts that are in the
navigation bar.

Bug: 26301185
Change-Id: I780a2ef9dd5ae2a4be9355b5874d08f521a86fa7
2016-01-06 12:05:35 -08:00
Jason Monk
87ccd55e8a Switch Tuner to support prefs (and some improvements)
Change-Id: I2ef62c0c56d4af69f9f34e1cfd297999d59b7da6
2015-12-16 19:41:25 +00:00
Winson
387aac6ad7 Fixing task view heights in paging tasks
- Now, all task views will be bounded by the stack rect, and the 
  thumbnail bitmaps will be scaled accordingly to fit either by width
  (when stacked) or to the view rect (when freeform)
- Fixing issue where the history button was not offset in freeform
- Tweaking thumbnail sizes of fullscreen screenshots
- Still requires changes to fix clipping to the correct aspect ratio in
  freeform.

Change-Id: I678b87c2f06947d32f3bb7c60a35f28eb36b5a68
2015-11-25 19:45:51 +00:00
Winson
8b1871d741 Adding tuner params for paging and full screen thumbnails.
- Adding “focused” stack state to support paging
- Changing the paging to match UX spec (only auto-page after the first
  tap)
- Removing old header focus animation

Change-Id: Id72825b8a1b1c0a2238ee184a6695b13c1d8cb1c
2015-11-23 15:55:52 -08:00
Winson
4993c2f17e Initial changes to stack layout to support paging and nonsquare thumbs.
- Moving to a couple piecewise curves to define the various overview
  layout states.  Added a new state for focus (to be used in follow up
  CL) to control paging of overview from the nav bar button.  This 
  allows us to control the visible range of items on the curve, and 
  to better fit other UI controls around the stack.
- Removed the scaling of the tasks in the stack
- Also refactoring parametric curve to just use the system Path

Change-Id: I4108da77986d86896576e36fa8f31189d6fcb6f3
2015-11-23 15:55:46 -08:00
Winson
e6c9073d81 Incorporating event bus to proxy recents events.
- Initial change to use the event bus by dispatching
  package events directly to the TaskStackViews instead
  of passing them down the view hierarchy manually.

Change-Id: Ic68df9eeefb79eab8ded84b74264a93719b40643
2015-10-01 13:33:59 -07:00
Jorim Jaggi
072707dfad Use RenderThread for navigation bar ripples
Bug: 17506181
Change-Id: Icf3b80f8c4bc29fe85313381d4019dda3ef85ea9
2014-09-16 17:51:55 +00:00
Michael Wright
c39d47a8e7 Add MediaProjection APIs.
The new MediaProjection infrastructure allows the system to hand out
tokens granting the ability to capture the screen's contents, audio,
etc. at a granular level. It's intended to be used both for screen
casting, via the cast APIs, as well as screen sharing via third party
applications.

The screen sharing case is implemented, but all of audio capturing
is still forthcoming.

Change-Id: I4b24669bed7083e11413c10ed8d6b025f5375316
2014-07-17 14:30:19 -07:00
Winson Chung
c637482a80 Removing unnecessary proguard flag for removed info view. 2014-05-21 00:31:43 +00:00
Winson Chung
9f9679d91e Adding experiment for app-info pane.
Change-Id: I647de1a71a2ac82da0a4f8a24125496dd5457441
2014-04-14 12:38:47 -07:00
Winson Chung
303e1ff1fe Initial changes for recents.
Change-Id: Ide2c202b4a5b25410f0f32bd0a81ccf817ede38f
2014-03-11 12:03:08 -07:00
John Spurlock
af56853020 Keep PhoneStatusBar default constructor around.
By keeping the entire class safe.

Change-Id: I0851ae5556243af2deb76f38500271059ffa4480
2013-09-23 11:15:11 -04:00
John Spurlock
8d356f37fe Remove obsolete class from proguard.
Change-Id: I98acdf63c021fa7a65de068cdd96e1db421af88c
2013-06-06 13:18:24 -04:00
Christopher Tate
acad183238 Add an empty stub status bar service implementation
For kiosk-type devices that do not present any navigation UI.  This allows
for clean selection of the implementation based on resource overlays,
without the need for the tablet or phone status bar implementations to
accomodate the desired behaviors.

Bug 5824373

Change-Id: Idcec70eef437904edda452b69e5eb7a3cc7094f7
(cherry picked from commit 5717f80927944c141f059162ecd69649488f8049 in ics-aah)

Signed-off-by: Mike J. Chen <mjchen@google.com>
2012-08-06 14:40:50 -07:00
Daniel Sandler
dfab18171c Protect animation methods from Proguard.
Bug: 5096417
Change-Id: I5546dfe0092747c311836bb2134b52be58d77b98
2011-07-29 12:41:25 -04:00
Daniel Sandler
ce70d91844 Lights out.
Not yet wired up to FLAG_FULLSCREEN; right now you must
invoke it manually by longpressing on the clock area.

Bug: 2905073
Change-Id: I43a005f2e4c08edb3673aef523bcaa1e088e8a71
2010-09-02 12:29:26 -04:00
Jim Miller
a10194936c Fix 2797185: Add recents to statusbar on xlarge device.
Change-Id: I9d2b099347b31189b96596273e38b5c2df8f4432
2010-08-30 17:54:42 -07:00
Daniel Sandler
aee242d3ec Fix Proguard flags causing crash in system bar.
Bug: 2869888
Change-Id: I32198676732a1f272b12154d87d7917f354bb91c
2010-07-30 22:01:34 -04:00