Commit Graph

256 Commits

Author SHA1 Message Date
TreeHugger Robot
5841a983e8 Merge "Launch work lock scrim as clear_top not single_top" 2017-01-26 16:41:44 +00:00
Robin Lee
588a333741 Launch work lock scrim as clear_top not single_top
SINGLE_TOP is only guaranteed to work within the current task stack.
If multiple stacks are inactive in the background (eg. temporarily
switching from freeform mode to fullscreen mode by maximising one
activity) some tasks might get missed out and stay visible.

Test: manual -- start two work activities, one in fullscreen & one in freeform. start a personal
Test: activity in freeform too. switch to the fullscreen work app and lock the profile using
Test: `adb shell service call trust 6 i32 $USER_ID i32 1`
Test: __outcome after change__
Test:   a) locking work profile should bring up the work password prompt in fullscreen
Test:   b) skipping the prompt and switching to the personal freeform app should keep the freeform
Test:      work app hidden by WorkLockActivity
Test: __outcome before change__
Test:   Only (a) happened, for step (b) the work app was still visible
Bug: 31001762
Change-Id: I5979c5b12670a21c7bcd59e222fc518d395e3e29
2017-01-25 19:19:34 +00:00
Dianne Hackborn
c3af19a87d Optimize bg check flow.
No longer need to look up the application info, target SDK is
explicitly passed in to the check.  For the external method, we
change this to just checked to see if background is completely
disabled, which doesn't need a target SDK check (and is the only
thing any of the current clients care about).

Now allow SystemUI to put targets of notification pending intents
on the temporary whitelist when they fire, so developers can avoid
dealing with background restrictions in this case (if the user
interacts with their notification, they will temporarily be
considered in the foreground).

Remove any thoughts of enforing restrictions on registerReceiver(),
so we don't need to deal with target SDK versions there (which can't
be done all that efficiently).

Also bring back the old "allow starts coming from foreground apps"
only for the MODE_IGNORE app op, since it should provide some
better compatibility.

Test: ran them.

Change-Id: Id4ea7f992d12ce4bd8e54f1dbaeb4a460a3dee59
2017-01-23 14:18:33 -08:00
TreeHugger Robot
b8e3643066 Merge "Add rankingScores and badges to WifiPicker." 2017-01-20 02:03:33 +00:00
Jiaquan He
9cea684079 2D Recents: handle keyboard config changes. am: 44db90262e
am: a925230cbc

Change-Id: Iae7e4908f1fe7aec921cb2bc03ba433aebb4e929
2017-01-20 01:33:30 +00:00
Jiaquan He
44db90262e 2D Recents: handle keyboard config changes.
While attaching or detaching a physical keyboard, we should handle the
configuration change in RecentsActivity, so that the activity isn't
relaunched and causes abnormal behaviors.

Test: Checked that while keyboard is attached or detached, Recents
behaves normally.
Bug: 32101881

Change-Id: Ibd185aeb48b31dbde032e235fdcaa17fbcdd9c8a
2017-01-19 15:29:54 -08:00
Sundeep Ghuman
5519b7b873 Add rankingScores and badges to WifiPicker.
Adds support to request scores in WifiTracker and then plumb
those scores via AccessPoint.java. AccessPoints will sort on
ranking scores. Show badging in WifiSettings picker.

Bug: 33457699, 33778046
Test: Unit tests
Change-Id: Icc3161cf147b3a9715d6e9f56af574e52ae6c832
2017-01-19 15:13:09 -08:00
TreeHugger Robot
97d9813245 Merge "Add one-shot plugin support" 2017-01-11 19:35:22 +00: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
Robin Lee
3fef1f2843 Bounce work challenge through a WorkLockActivity
This stops us from depending on Settings for keeping the work profile
secure. Instead that is delegated to a smaller Activity inside SystemUI
which has just two jobs:

 1) Don't let anyone see the content that's supposed to be locked.

 2) Start ConfirmCredentialsActivity (still lives in Settings for now)

Bug: 31001762
Test: //cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/MixedManagedProfileOwnerTest#testResetPasswordFbe
Test: //tests/PoApi/src/com/google/android/afwtest/poapi/WorkChallengeTest
Change-Id: If43820b683007a60a37edf32fb65b442a8fb709b
2017-01-11 14:13:03 +00:00
Winson Chung
c75ffe8ccb Fixing some interaction issues with the PIP menu.
- Due to jank when finishing the PIP menu activity, we handle the
  menu visibility explicitly and keep the menu activity around
  once triggered (until PIP ends), instead of finishing and
  recreating it each time it is invoked.  This also gives us the
  flexibility to control how the animation looks of both the menu
  and individual actions.
- Allow dragging the PIP while the menu activity is showing and
  taking input
- Tapping outside of the PIP now hides the menu

Test: Enable the tap-to-interact in the SysUI tuner and drag while
      the menu is showing.

Change-Id: Iac74710100d793e6825b00c7c0d71b85fb420fa0
Signed-off-by: Winson Chung <winsonc@google.com>
2017-01-03 11:28:37 -08:00
Manu Cornet
e93f8100a6 DO NOT MERGE - Delete the separate grid recents activity and related code
This was the first attempt at implementing grid-based Recents.
The new implementation doesn't use a separate activity and reuses a lot
more code.

Bug: 32101881
Test: Checked Recents behavior on local sw600dp device
Change-Id: Ic3535fc49f3f5448d6002d354678b633f122f57d
2016-12-20 17:52:45 -08:00
Manu Cornet
8e17342610 Delete the separate grid recents activity and related code
Bug: 32101881
Test: Made sure everything builds & boots on sw600dp device and checked recents
Change-Id: I1236a1ec5f5d2f485d9825c39702130bbfc243ca
2016-12-16 16:31:19 -08:00
Manu Cornet
c733803433 Revert "Grid recents: tweak task header layout to better match mocks"
This reverts commit 4701b99356.

Change-Id: Id1a2f93f55b32e6544083254bb16e3d3722aa3dd
2016-12-13 17:32:20 +00:00
Manu Cornet
4701b99356 Grid recents: tweak task header layout to better match mocks
Test: Checked layout on local sw600dp device
Bug: 32101881
Change-Id: Ic205beea47fc67fca9b3c95b3d1318c156ccc9c1
2016-12-13 07:26:03 -08:00
Manu Cornet
e138bd1955 Change the task layout to better match mocks, add "in" animation
This only adds an animation when transitioning into recents. "Out"
animations will come later as they need to be run in parallel with
launching the activity not to introduce any latency.

Test: Open recents on sw600dp device, check recents layout/animations
Bug: 32101881
Change-Id: I367f8e5c106cd06d2a7833c165ecb960a7821ed9
2016-11-23 14:48:30 -08:00
Manu Cornet
c13df1eb30 DO NOT MERGE - 2-dimensional Recents activity.
This is a simple first version in the spirit of small, incremental CLs.
It is fully functional but the following will come in later changes:

* Split screen support
* Potential animations
* Alt-tab behavior
* Relayout on orientation changes

The new activity is only started when a specific system property is set.

Test: Tested new activity behavior on local Ryu. Added tests for layout logic.
Bug: 32101881
Merged-In: I550f6e7ea0de3937dbf80e5f0294676cfe567d47
Change-Id: I46a537646e98b312d831510e1d331948888ae5ce
2016-11-11 12:57:07 -08: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
Manu Cornet
1afcea499d 2-dimensional Recents activity.
This is a simple first version in the spirit of small, incremental CLs.
It is fully functional but the following will come in later changes:

* Split screen support
* Potential animations
* Alt-tab behavior
* Relayout on orientation changes

The new activity is only started when a specific system property is set.

Test: Locally on Ryu device. Added tests for layout logic.
Bug: 32101881
Change-Id: I550f6e7ea0de3937dbf80e5f0294676cfe567d47
2016-11-07 10:01:36 -08:00
Winson Chung
15504af3f7 Experiment with allowing tap to break through to interact with the PIP.
Test: Enable SysUI tuner, tap once on PIP to interact with the activity.
      This is only experimental behaviour, and
      android.server.cts.ActivityManagerPinnedStackTests will be updated
      accordingly if we keep this behavior.

Change-Id: I278ab8c360c44718cfcac0fd761f476a875f9b15
2016-11-02 18:11:36 -07:00
Winson
bf8c2c0f99 Moving TV PIP logic to the PIP sub package.
Test: Existing tests pass.
Change-Id: I4ca1f68d01206cb2fc7de27f3d445d6ac13d644a
2016-10-24 11:32:07 -07:00
Nick Kralevich
8b1ff5545d Delete unused broadcast receiver am: bee3ea12cc am: 6c7d18bdb2
am: 44530fb20c

Change-Id: Ib15ec676179b56e267f18b38071ffdb685043f47
2016-10-11 23:05:31 +00:00
Nick Kralevich
bee3ea12cc Delete unused broadcast receiver
Bug: 32090921
Bug: 21388590
Change-Id: I27e9ce7b55d0568644f9360368e90150d9be890e
2016-10-11 14:00:54 -07:00
Nick Kralevich
44761c81eb Delete "Show CPU usage" am: fc4a5c2d85 am: f0c0188a8a
am: 34547a8dc2

Change-Id: I410846d3ff6856e5f9dee2efd551af8b9d1d94dc
2016-10-11 18:21:32 +00:00
Nick Kralevich
fc4a5c2d85 Delete "Show CPU usage"
This functionality hasn't worked since Lollipop.

Bug: 21388590
Change-Id: Ie4388d88f6e06f3e2d2e84e9c4515b3ebc6a0ea5
2016-10-11 09:01:38 -07:00
Fan Zhang
38b4725108 Add a temporary activity-alias for TunerActivity.
Bug: 31781480
Test: make SystemUI, and manually inspected sysui appears in
Settings. Turning off sysui tuner still works.

The new alias is used by Settings to display sysui tuner in a different
category instead of in homepage directly. The display location is
controlled by category metadata. We need a alias because the category
metadata is different between new/old activity.

Change-Id: Ie4f2c1f6017459e34227155c83a7767f2003b18b
2016-10-06 09:21:23 -07: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
Rubin Xu
4e49129caa Not longer need MANAGE_DEVICE_ADMINS permission.
This was added to show policy transparency dialog with custom support
message, but the check is now removed so no need to hold this permission.

Bug: 30582906
Change-Id: Ica9d3ac052503cc2fe2c469e8b52cf0090959071
2016-08-08 15:26:01 +00:00
Rubin Xu
1573d8be78 Not longer need MANAGE_DEVICE_ADMINS permission.
This was added to show policy transparency dialog with custom support
message, but the check is now removed so no need to hold this permission.

Bug: 30582906
Change-Id: Ica9d3ac052503cc2fe2c469e8b52cf0090959071
2016-08-02 16:28:55 +01:00
Jaewan Kim
cdedf154e9 PIP: Handle layoutDirection changes am: 73ef3516d2
am: a474716ffe

Change-Id: If543450cddf8d138df4b9db8d139e3dde223a3ec
2016-07-25 01:04:37 +00:00
Jaewan Kim
73ef3516d2 PIP: Handle layoutDirection changes
Bug: 30145777, Bug: 28826668
Change-Id: I43c39b3d3dff279c0a61f8d5872819457ccad4d4
2016-07-19 18:32:02 +09:00
Dan Sandler
6ebc3e5c15 Cats are not, technically, tasty treats. am: 27a9fcc618 am: fadfc8e5e5
am: b6d9598690

Change-Id: I47523b80a8d2502012dea265fe09855db4c1bc35
2016-06-26 23:07:23 +00:00
Dan Sandler
b6d9598690 Cats are not, technically, tasty treats. am: 27a9fcc618
am: fadfc8e5e5

Change-Id: Id974d6c8f76e4f94f2ad1c88383f4a43060fe859
2016-06-26 23:03:39 +00:00
Dan Sandler
1b2ed4394c Cats are not, technically, tasty treats.
am: 27a9fcc618

Change-Id: I6ffdf66c9ef70052b7ba5ac5d926b32eae633fde
2016-06-26 22:55:59 +00:00
Dan Sandler
27a9fcc618 Cats are not, technically, tasty treats.
Bug: 27376882
Change-Id: I97183339e51c5d07fe6e9404bbcc5178ca605c05
Copilot: Jason Monk <jmonk@google.com>
2016-06-26 15:00:11 +00:00
Makoto Onuki
092d4e91e8 Merge \\"Shortcut: Reset throttling upon inline reply\\" into nyc-mr1-dev am: 489bafbb4b
am: 58b2258506

Change-Id: I7034cc9ef130c9dccfa35a8cb75940d717a2a15d
2016-06-16 17:17:56 +00:00
Makoto Onuki
d6e1f3bec1 Shortcut: Reset throttling upon inline reply
When the user does an "inline reply", we consider the notification
publisher app is "activated" and reset the shortcut throttling.

Bug 28705275

Change-Id: Ic9ffa13635274ead7e9d1e832cd31dea997830aa
2016-06-14 14:12:07 -07:00
Wale Ogunwale
6cab2d50e2 Merge "Change ForcedResizableInfoActivity to handle config. changes" into nyc-dev am: 8a111f5f20 am: 87edcf3d3c
am: 9d747d7cf7

* commit '9d747d7cf7098ab0370770af99ee65dbc766edae':
  Change ForcedResizableInfoActivity to handle config. changes

Change-Id: I48292d516cbefff3888ea5586dff201db88c0af3
2016-05-09 18:40:17 +00:00
Wale Ogunwale
3840c88938 Change ForcedResizableInfoActivity to handle config. changes
This created extra churn in the system during resize due to
the activity relaunching.

Bug: 28614747
Change-Id: I148b6fca3dad7e10c90085a04bccb99587397912
2016-05-07 14:13:52 -07:00
Dan Sandler
0551b0f42a resolve merge conflicts of c635525 to master
Change-Id: I33b31ce36bbf255408ac50b87ed29f3957c9d533
2016-04-25 17:32:50 -04:00
Dan Sandler
d52ea0c218 Show "Android System" instead of "System UI" in screenshot notifications.
Bug: 26517701
Change-Id: I0f4a58531066c49fed90bcdd78c92a4f212ada3b
2016-04-23 14:43:57 +00:00
Andrei Stingaceanu
203ae48ff7 Merge "Keyboard shortcuts: dismiss when activities start via shortcut" into nyc-dev am: 1a83df8ba7 am: 9e16d11683
am: e0ea2e06ab

* commit 'e0ea2e06abafdde2974b8976ececd727e590060c':
  Keyboard shortcuts: dismiss when activities start via shortcut

Change-Id: Ic86b86c3254318d17059b4650a9c7bcb652bddf3
2016-04-22 17:06:50 +00:00
Andrei Stingaceanu
0bf096f1b4 Keyboard shortcuts: dismiss when activities start via shortcut
* introduced a new intent DISMISS_KEYBOARD_SHORTCUTS and
and new public API in Activity (which sends a broadcast
to KeyboardShortcutsReceiver) which applications can
use to dismiss the keyboard shortcuts.

* plumbing and implementation for a new call to dismiss
keyboard shortcuts from PhoneWindowManager and used it:
** when starting activities invoked via Search+key
** when starting activities invoked via META
** when starting activities via application launch keys

* removed unused variable in
Activity#onProvideKeyboardShortcuts

Note that for apps started via touch (aka non-shortcut)
like tapping the Settings gear icon from the notification
bar the menu is not automatically dismissed.

Bug: 28012198
Change-Id: I83a8d4f342bb8a08115a648648834d0d2bac19fd
2016-04-22 16:57:25 +01: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
8af20ef6a8 Merge "The return and fixing of demo mode" into nyc-dev 2016-04-12 18:53:20 +00:00
Jason Monk
98d7c7a84d The return and fixing of demo mode
Change-Id: I2bcf3435b92c80b4ab3c46cba02902820c942c7c
Fixes: 27919212
2016-04-12 13:08:31 -04:00
Daniel Sandler
064e612779 Merge changes from topic 'vr-fixes' into nyc-dev
* changes:
  Suppress immersive mode confirmation in VR mode.
  Suppress heads-up notifications in VR mode.
2016-04-12 14:57:41 +00:00
Dan Sandler
dc34df5d31 Suppress heads-up notifications in VR mode.
Fixes: 27884853
Change-Id: I14d2dd66bea5b18e4d710c74d443e88cfbb3c028
2016-04-11 12:42:14 -04:00
Clara Bayarri
eb3c2d3e63 Expose the Keyboard Shortcuts Helper in Activity
This allows apps to trigger it from their own menus

Bug: 27811273
Change-Id: I028caa5a88bb0e1c51238db28bb496293b78f90b
2016-04-07 13:35:23 +01:00
Winson Chung
fef8cfc3f0 Merge changes I1bad66e2,Ibc93597e,Id985fc28 into nyc-dev
* changes:
  Remove the highlight on the overview button in the screen pinning dialog
  Fixing bad regression in alt-tab layout.
  Workaround to ensure that a SystemUI process is always available.
2016-04-06 17:50:31 +00:00