Commit Graph

442 Commits

Author SHA1 Message Date
timhypeng
1747dbbc40 Add dismiss intent and method for MediaOutputDialog
-Add filter in Manifest
-Add dismiss method in MediaOutputDialogFactory

Bug: 155822415
Test: build pass
Merged-In: Ica5b5a22e0fa20ffec5ab9ea291f72c06e39c2fe
Change-Id: Ica5b5a22e0fa20ffec5ab9ea291f72c06e39c2fe
2020-12-02 03:29:15 +00:00
timhypeng
34f4c21fd3 Rename MediaOutDialogReceiver to MediaOutputDialogReceiver
-Typo

Bug: 155822415
Test: build pass
Merged-In: Ib275b97f5ff03dffb8aeb91b658dbb7c035b96f4
Change-Id: Ib275b97f5ff03dffb8aeb91b658dbb7c035b96f4
2020-12-02 03:28:52 +00:00
timhypeng
80a46198fc Add a receiver to launch Output Switcher dialog
-The receiver launches dialog with TYPE_APPLICATION_OVERLAY window
type
-Add receiver in manifest
-Add bindMediaOutDialogReceiver() for Dagger

Bug: 155822415
Test: build pass

Merged-In: Icb5a1f241e644307491030ed721939c18269ff86
Change-Id: Icb5a1f241e644307491030ed721939c18269ff86
2020-12-02 03:28:37 +00:00
TreeHugger Robot
3b5abd1335 Merge "Introduce INPUT_CONSUMER permission for InputConsumer" into rvc-qpr-dev 2020-09-23 10:16:56 +00:00
Fabian Kozynski
3223c578cb Merge "Make dialog not exported" into rvc-qpr-dev 2020-09-03 13:20:03 +00:00
Fabian Kozynski
e92b7d792c Make dialog not exported
Apps must go through ControlsProviderService.requestAddControl

Test: test app
Fixes: 167566024
Change-Id: I50424cb0ff1c66eeacaa7a8af5beed9d5e973384
2020-09-02 12:46:00 -04:00
arthurhung
80951fa9a8 Introduce INPUT_CONSUMER permission for InputConsumer
Add the permission protect to createInputConsumer/destoryInputConsumer
in WindowManagerService to prevent it is possible for an app to consume
all the touch events and deny them from even reaching System UI.

Also fix the wallpaper inputconsumer should only show when we found a
visible wallpaper window.

Also limit 'createInputConsumer' to the defined types.

Test: atest PermissionPolicyTest
Test: ceate/destory an inputconsumer and test input
Fix: 162324374
Merged-In: I7a4c2c4cba7ea670873ab2ac49b9880d9a65cd86
Change-Id: I7a4c2c4cba7ea670873ab2ac49b9880d9a65cd86
(cherry picked from commit 0d0ad1b60b)
2020-08-26 15:19:43 +00:00
Fabian Kozynski
5f617413aa Add MODIFY_AUDIO_ROUTING permission to systemui
Adds the privileged permission for AppOpsControllerImpl.

Test: build and record
Fixes: 164213112
Change-Id: Ib23749542bb41eb1df2fb7cfe62db57fba73d0cf
2020-08-14 11:40:29 -04:00
Fabian Kozynski
9a85dc9c0a Merge changes from topic "permission_chip" into rvc-qpr-dev
* changes:
  Restricts notified app ops based on flags
  Add back privacy chip
2020-07-23 13:45:26 +00:00
Miranda Kephart
c07f0a910f Move screenshot receivers and add tests
Moves the various broadcast receivers out of GlobalScreenshot and
adds unit tests for them, along with some other changes to make
them more easily testable:
    - ScreenshotSmartActions is now a stateless injectable class,
      instead of a collection of static methods
    - DeleteImageInBackgroundTask removed, in favor of just calling
      a background executor directly
    - remove the TargetChosenReceiver (used to remove notifications
      after a share target is chosen) since we're not using
      notifications anymore

Bug: 160325487
Test: atest SystemUITests, plus manually checked that screenshots
continue to function as expected

Change-Id: I1c054dddd76404f385e59f7ab7317beaafde1106
2020-07-21 16:48:12 -04:00
Fabian Kozynski
fd89d72b13 Restricts notified app ops based on flags
AppOps that are received by SystemUI and notified to listeners of
AppOpsControllerImpl are filtered based on the permission flag
PackageManager.FLAG_PERMISSION_USER_SENSITIVE_WHEN_GRANTED.

As calls to obtain this flag require an IPC, three things are done to
mitigate impact:
* PermissionFlagsCache keeps track of requested flags and will update
those (in a background thread), when a change is notified for a given
uid.
* Calls to getActiveAppOps/getActiveAppOpsForUser should be made from a
background thread.
* notifySubscribers is always called in the background thread.

Bug: 160966908
Test: atest PermissionFlagsCacheTest AppOpsControllerTest
Change-Id: I871094c32ce5ec940d779626333caa0ca500a4e3
Merged-In: I871094c32ce5ec940d779626333caa0ca500a4e3
2020-07-20 16:02:19 -04:00
Beth Thibodeau
231ac9bced Screen record user switching fixes
Allow opening the dialog in all users
Stop recording when the user changes
Post notifications in the correct user

Still some issues with tile state and status bar but those require more
work to coordinate across users, so may not make it into R
(related bug: b/158004991)

Fixes: 147921212
Bug: 148955577
Test: manual
Test: atest ScreenRecordTileTest
Test: atest com.android.systemui.screenrecord
Change-Id: Idf10931c5ddf3079b903708824fae11135169c1b
2020-06-25 11:40:22 -04:00
Charles Chen
b28fb721f5 Trust System UI owned display to receive keys
A11y service cannot get focus of bubbles because it's not a
System owned display. This patch makes System UI owned display
a trusted display. Moreover, this patch refactors the logic to
identify a trusted display by introducing FLAG_TRUSTED and
removes the trusted display check along with supportsSystemDecorations()
because the check has been included in supportsSystemDecorations().

fixes: 155823002
Bug: 152416787
Test: atest DisplayContentTests
Test: atest WindowFocusTests
Test: atest TaskDisplayAreaTests
Test: atest MultiDisplaySystemDecorationTests
Test: atest DisplayTest
Change-Id: Ie684c6488904e5aa8cae166a455c6d55455e5f55
2020-06-16 02:10:21 +08:00
Matt Casey
02805f050b Revert "Hide bubbles' IME after screenshot is taken."
This reverts commit d56eaf68f6.

Reason for revert: Causing a sysui crash
Bug: 157756391

Change-Id: I9df1bf4a3e9e6cb2f03218ba3c56c7c5660483c7
2020-06-11 00:20:16 +00:00
Matt Casey
d56eaf68f6 Hide bubbles' IME after screenshot is taken.
Needed to create a separate receiver to handle this as GlobalScreenshot
is in the screenshot process.

Bug: 157756391
Test: Open IME in bubble test app, take screenshot, verify that IME goes
      away and does not interfere with screenshots UI.
Change-Id: I93d050340e59c5b45250f53eb943697fa543b706
2020-06-09 15:43:56 -04:00
Alex Johnston
ea2808e6de Merge "Remove black flash when unlocking work profile" into rvc-dev 2020-05-26 18:34:29 +00:00
Alex Johnston
823503a16a Remove black flash when unlocking work profile
* Remove black theme of WorkLockActivity. The activity
  below will still not be displayed because there is
  a blankView added in onCreate().

Manual testing steps
* Create a work profile and set a work profile lock
* Launch a work profile app
* Lock and unlock the screen
1. * Enter in the work profile credentials
   * Observe no flash is observed
2. * Return from the lock screen
   * Observe the activity below is not displayed

Bug: 149286440
Test: Manual testing
Change-Id: I18dd66067164e19e81e5fcbc46aa0879fe367a68
2020-05-26 14:02:59 +01:00
TreeHugger Robot
3ccf874dca Merge "Screen recording doesnt record internal audio" into rvc-dev 2020-05-18 16:37:11 +00:00
TreeHugger Robot
dfc677f707 Merge "a11y for controls rearranging" into rvc-dev 2020-05-18 13:13:54 +00:00
Jay Aliomer
c2094aedcc Screen recording doesnt record internal audio
Fixes: 156645454
Test: manual
Change-Id: I3be1df0e6261750b2fe923650ee3359414fce642
2020-05-16 17:58:25 -04:00
Fabian Kozynski
93a6975a9e a11y for controls rearranging
This CL adds local context actions for rearranging controls. The actions
allow to move each current favorites one position at a time.

Test: manual
Fixes: 155997794

Change-Id: I3dbace5c11bb93830315ca57513744464595cc16
2020-05-14 16:40:04 -04:00
Wesley.CW Wang
83812aca78 Disable ClockOptionsProvider
- Since we reverted to Q's wallpaper picker on Android R, the picker side won't include our fix(ag/10371523) to hide the clock tab, so we need to disable the provider on the framework side on rvc-dev, make picker side won't show any clock options in this case

Bug: 155656424
Test: `adb shell content query --uri content://com.android.keyguard.clock/list_options` will not list available provider
Change-Id: I25af259ab65639eb3087511d2e221fb2242cbd73
2020-05-14 10:34:51 +00:00
Fabian Kozynski
1fcc8c4c7e QSTileHost use overrideableByRestore
Starting in this release, settings that were set (after the first time)
will not be overriden by restore. This does not work with QSTileHost as
there are many things that may override secure sysui_qs_tiles without
the user directly taking an action (for example, packages that are
uninstalled or updated, may make tiles unavailable), changing the set of
current tiles.

In the case the restore is delayed, (for example D2D), it'd be good if
this setting is restored, regardless of changes that may have happened
in the intervening time. Marking all saving of this setting as
overrideableByRestore may make some changes to be lost, however it's
thought to be the better alternative, because of the following:
 * It continues the behavior from previous releases, preventing a
 regression.
 * If the user is using D2D, we can assume that they expect those tiles
 to be restored without changes.
 * If the user is using another restore method and they made changes to
 the tiles, this will override them, but it's no different than previous
 behavior.

Also, use the cached currentUser.

Fixes: 153835600
Test: build
Change-Id: Id8f28ff4731556f7ccbee468e06cd3e03324f201
2020-05-12 12:47:53 -04:00
Fabian Kozynski
e34b132442 Merge "Fix redlines and strings in Controls dialog" into rvc-dev 2020-05-05 13:37:51 +00:00
Fabian Kozynski
4429ee6d93 Fix redlines and strings in Controls dialog
Also, make sure that it appears on top of the app

Fixes: 155205745
Test: manual
Change-Id: I56ebae4ef6bdf1c89850a4ad70be05b37e3cd0cb
2020-05-04 12:44:41 -04:00
Matt Pietal
b2c7a4407b Controls a11y - Various fixes
1. Long press on togglerange controls
2. Range status text now corrected displayed when using seek controls
3. Check for valid intent before opening
4. Fix the activity titles

Fixes: 153283023
Fixes: 152932546
Fixes: 152924457
Test: talkback
Change-Id: Ic90cd9de660426838ed2a63e6079224d65c8e6d2
2020-05-01 13:33:37 -04:00
Fabian Kozynski
5f561f0b01 Fix back and cancel flows
This fixes all the back flows (finishing activities when they are not
needed). Also fix some transition animations.

Add a toast when "See other apps" is selected with changes done. This
will appear even if something is changed and reverted, as that kind of
thing is not tracked.

Test: manual, go over flows
Fixes: 154741024

Change-Id: I24611f4f32e41c7dd3774620518f2945db081727
2020-04-28 14:42:09 -04:00
Bernardo Rufino
c7988a90c7 Allow sysUI to send a11y events for other package and user
As discussed, we:
* Allow apps with INTERACT_ACCROSS_USERS(_FULL) to specify an explicit
user (instead of just USER_CURRENT).
* Introduce new signature permission ACT_AS_PACKAGE_FOR_ACCESSIBILITY
and grant it to sysUI. This permissions allow holders to specify another
package on behalf of which they can perform a11y operations.

This is for toasts since now sysUI renders toasts on behalf of the app
for apps targeting R+.

Bug: 152839254
Test: atest FrameworksServicesTests:AccessibilitySecurityPolicyTest
      FrameworksServicesTests:AccessibilityWindowManagerTest
      android.widget.cts.ToastTest
Change-Id: I3541045d574518571f348051d53e24ff1a4a67ef
2020-04-22 17:23:52 +00:00
Fabian Kozynski
0935694b5a Merge "Add controls rearrange activity" into rvc-dev 2020-04-10 21:02:01 +00:00
Matt Pietal
269a7b4dce Controls a11y - Set activity titles
Set proper activity titles and do not use the default application
label. Do not allow the status text to be focusable.

Bug: 152924457
Bug: 152932546
Bug: 152927300
Test: talkback

Change-Id: Ieed21596c8160aaf945d71e274706c771f7e4693
2020-04-10 13:40:22 -04:00
Fabian Kozynski
8765d35779 Add controls rearrange activity
This activity is accesses from the overflow menu in the Controls UI. It
does the following:

* Shows all favorites for current structure
* Allows for rearranging current favorites in that structure
* Allows for removing current favorites in that structure
* Links to ControlsFavoritingActivity with just that structure

Test: manual
Test: atest ControlsControllerImplTest
Test: atest FavoritesModelTest
Test: atest AllModelTest
Fixes: 149138395

Change-Id: I8a57d4f835467247b7cc360fee4e382cd5553481
2020-04-10 10:18:57 -04:00
Sergey Nikolaienkov
d07dc4d4cc Account for mic fgs in AudioRecordingDisclosureBar
Take into account foreground services of type 'microphone' in
AudioRecordingDisclosureBar - watch processes that run such fg services
and treat them as so they are already recording.

Bug: 152364373
Test: make, run audio recording app
Change-Id: I7961ad332d5741a12f029dcc95e909572f30ad05
2020-04-06 19:45:52 +02:00
Fabian Kozynski
66e975404c Added Backup & Restore for SystemUI and controls
This CL adds support for Backup & Restore in SystemUI by adding
Key-Value BR through the use of a BackupAgent (BackupHelper.kt). Right
now, the only thing that is backed up in SystemUI is the
controls_favorites.xml file.

BackupAgent will send a broadcast to user 0 indicating that the restore
has been completed for a particular user.

Regarding controls BR:
* The file is set as changed every time it is written and will
participate in normal backups as determined by BackupManager.
* On restore, a copy is made to serve as cache of controls restored but
whose app is not installed yet.
* This cache is persisted for a week and deleted with a JobService.

Test: atest SystemUITests
Test: manual using LocalTransport
Fixes: 149210531

Change-Id: I6048f1ebd1d9021058778dff707c8c53c9989b35
2020-03-30 11:19:22 -04:00
Govinda Wasserman
6aea969ed4 Remove test service for Assistant Handle requests
This service was added for testing and is no longer needed.

Test: Tested locally
BUG: 152189559
FIX: 152189559
Change-Id: I824dd1956e8b7e42d2e00dac7771d58c00b74338
2020-03-24 11:33:39 -04:00
Shuzhen Wang
6d76d3b1f6 Camera: Add new hidden API for camera open/close callback
The hidden API is used by SystemUI process to adjust the system UI based
on when a certain camera is opened or closed.

Test: Manually observe callbacks in SystemUI when running camera CTS
Bug: 150540299
Change-Id: I04cae782d96f0e32be8ef588dcd328f84b32887a
2020-03-10 09:35:50 -07:00
Fabian Kozynski
04e7bdef04 Add dialog for recommended controls
The dialog can only be requested if the package of the controls provider is
currently in the foreground.

This is accomplished by querying Activity Manager about the
UidImportance of that package. Added
android.permission.PACKAGE_USAGE_STATS to SystemUI for this.

Test: atest
Test: manual
Fixes: 149410221

Change-Id: Ifdf479d8dbc70502da95d362e3bfd60ad3c561fb
2020-03-06 12:55:35 -05:00
Ned Burns
6a989fbffe Merge changes from topic "migrate-dump"
* changes:
  Migrate DumpController -> DumpManager
  Add service for dumping at NORMAL priority
  Introduce DumpManager
2020-02-21 22:54:49 +00:00
Ned Burns
e33b495c7d Add service for dumping at NORMAL priority
SystemUIService is hard-coded to dump at CRITICAL priority and so can't
dump very much (and, most importantly, can't handle dumping our length
log buffers). So instead we create a new service,
SystemUIAuxiliaryDumpService, which will dump alongside all other
services in the NORMAL section. Its dump method calls straight into the
DumpManager.

Test: atest, manual
Change-Id: If76f206081a1663e23fc14076b50bef7396e517f
2020-02-20 22:11:31 -05:00
Joshua Duong
21819bf32d [adbwifi] SysUI: Add WifiDebuggingActivity.
This will prompt the user whether they trust the current wireless access
point when enabling wireless debugging.

Bug: 147814644

Test: make
Exempt-From-Owner-Approval: already approved
Change-Id: I56a7c022f26d4e3d93a22d9022f19f1b8d997d70
2020-02-20 13:49:58 -08:00
Wesley.CW Wang
5db44f0ece Enable custom clock feature
- Enable ClockOptionsProvider and the flag let SystemUI(keyguard) have
the ability to apply custom clock
- Remove Analog and Bubble clock from SystemUI

Bug: 146530441
Test: `adb shell content query --uri content://com.android.keyguard.clock/list_options` will list available provider, `adb shell settings put secure lock_screen_custom_clock_face "com.android.keyguard.clock.BubbleClockController"` will not switch to Bubble clock.
Change-Id: Iecfb5e2ea0cc72ca6eb1e16ca0dc0213a3257b6e
2020-02-19 15:04:28 +08:00
Fabian Kozynski
9aa23af654 Changes to favorite management screen
This changes are to include the new UX flows:

* The list of controls is split by zones. All controls that do not have
a zone (blank or null) are shown at the beginning of the list. Zones are
sorted "alphabetically".
* Controls are split into Favorites and All, with Favorite controls
appearing twice. Toggling the checkbox in a control from any of the two
lists will change the state and make it appear/dissapear from the
favorites list.
* Changes to favorites are only saved on Done.
* Favorites can be rearranged by dragging and dropping.

Test: manual
Test: atest
Bug: 149138395

Change-Id: Ib5fdbc66cafe03e95855eb6c16c27127afa8d565
2020-02-10 10:31:05 -05:00
Fabian Kozynski
8b5404502d Minor controls fixes
* Check setting for correct user
* Remove admin restriction
* Cache available setting in ControlsController
* Make activities exported=false
* Add settings listener

Test: manual
Test: atest ControlsControllerImplTesst
Bug: 147732882

Change-Id: I003ee3ea8f725d4da79729ce76816d4a1615fb0d
2020-02-04 20:38:44 -05:00
Fabian Kozynski
5fc5f6ba48 Polish controls management activities
* Change to no toolbar and add title and subtitle
* Change individual controls to use lozenges (same layouts as in the
controls space).

Test: manual
Bug: 148207527
Change-Id: Ie0f3c53ca12dbe29aa1e4469fc0146e29f548d76
2020-02-04 11:33:08 -05:00
Fabian Kozynski
7988bd464d Add multi-user support to Controls
This commit adds multi-user support by doing the following:
* Listening when user changes and switching the controllers user (and
context).
* Using activities that show for all users and are finished on user
switched.

The setting has to be enabled for each user separately.

Also:
* fixes calling subscribe when on load to the ControlsProviderService.
* better dumps.

Test: atest
Test: check that files are not shared between users
Test: check that user folder is removed when user is deleted
Bug:147732882
Change-Id: I349b0136473016e6bd6b71e26045f11a839272d1
2020-01-31 09:11:38 -05:00
Zim
72c7ef5034 Request MANAGE_EXTERNAL_STORAGE permission
With the deprecation of WRITE_MEDIA_STORAGE in R. Apps should migrate
to requesting MANAGE_EXTERNAL_STORAGE permission

Test: m
Bug: 144914977
Change-Id: I6ea64006fbba7a792d7c59a1c5ae526357fe8894
2020-01-24 22:37:46 +00:00
Sean Pont
d00aefb43c Add QuickAccessWallet API
Adds a new API that allows applications to provide payment cards and
other relevant passes to SysUI which are then shown in the Quick Access
Wallet (long press on Pixel). See go/aospqaw-dd for details.

Bug: 144342153
Test: manual - started device, didn't blow up
Test: atest - run from frameworks/base dir
Change-Id: I8fef3116e6e4bd1f8a4f5a907892ea8993b49b0e
2020-01-21 14:18:34 -08:00
Automerger Merge Worker
2a7b367d06 Merge "Replace CONNECTIVITY_INTERNAL in SystemUI" am: 3950a24dca am: 8d82c3cbd9 am: 8e92458626
Change-Id: Id94e38dafad3dd6a5316c53ba357a8004a7d7b9e
2020-01-16 07:58:53 +00:00
Automerger Merge Worker
8e92458626 Merge "Replace CONNECTIVITY_INTERNAL in SystemUI" am: 3950a24dca am: 8d82c3cbd9
Change-Id: I0ef7475de6266ac7534e549a89a8418c8ea5bb3d
2020-01-16 07:47:01 +00:00
TreeHugger Robot
0b56225ecf Merge "Add screen recording QS tile" 2020-01-15 21:29:10 +00:00
Fabian Kozynski
d31226a0a6 Merge "Adding controllers for Controls" 2020-01-15 21:10:00 +00:00