Commit Graph

17968 Commits

Author SHA1 Message Date
TreeHugger Robot
12f1567f76 Merge "Update link for Permissions samples in Javadoc" into rvc-dev am: 82a1ff7a94 am: 4224da2b2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13159866

Change-Id: I2dda484cb7780e15153442d29bc180045604aadb
2020-12-03 18:43:31 +00:00
Tiem Song
a9565b2cb0 Update link for Permissions samples in Javadoc
Bug: 158042826
Change-Id: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Merged-In: I71ab17b21b31ff6584facd023e4c4818b0ab1b55
Test: N/A
2020-12-02 20:50:04 -08:00
Ahaan Ugale
19e29925ee Allow only preloaded voice recognition services to blame calling apps.
Bug: 170795434
Test: manual
Merged-In: Ided2b19661d937ff0b4ec881f2e629afe47435e5
Change-Id: I92a146e5763afd07a44f8e9c7a3c71a27d1f16bd
2020-11-21 03:29:40 +00:00
Jordan Jozwiak
cad8a4f55e Merge "Do not power off display on lockNow() on automotive builds." into rvc-qpr-dev 2020-11-18 17:46:30 +00:00
Felipe Leme
b7c8877ba1 Do not power off display on lockNow() on automotive builds.
Test: manual verification
Fixes: 171517112

Change-Id: I410e06b911b099c0ed4b7b4e3ac493c9a272fa6b
Merged-In: I410e06b911b099c0ed4b7b4e3ac493c9a272fa6b
(cherry picked from commit fc586009b1)
2020-11-11 22:43:19 +00:00
Joanne Chung
6aaa106d83 Allow voice recognition service to blame other apps access.
This is a workaround solution for Android R QPR2. We are not allowed
to change the API for QPR release. This is a special case that allows
the current voice recognizer to note proxy ops if it is also the
voice interactor. In S, we will define a new permission that designed
one as a trusted blamer and tie it to a role.

Bug: 17095434
Test: manual
Test: TreeHugger presubmit

Merged-In: I506bbeb95e622b99693dbf5a135c7961b7fd81c1
Change-Id: I0852d1bb438d25b3e93224a71de1bf3b6df72c1c
2020-11-11 11:04:15 +08:00
Charles Chen
2fb8485fbb [RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"" am: c947b10f99 am: 1e0cf0c900
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12816011

Change-Id: I40987bec1e53324e4036ffe4325c6dc8328c29da
2020-10-16 18:56:16 +00:00
Charles Chen
1e0cf0c900 [RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"" am: c947b10f99
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12816011

Change-Id: I174d70795eae849ca346fb79528e418a5003f76a
2020-10-16 18:39:01 +00:00
TreeHugger Robot
8b1151e4d5 Merge "[RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays""" into rvc-dev 2020-10-16 18:26:02 +00:00
Charles Chen
c947b10f99 [RESTRICT AUTOMERGE] Revert "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays""
This reverts commit ae03031efe.

Reason for revert: Merge the reverted patch by accident.

Bug: 162627132
Change-Id: Ic2f072730050cb47926cec6ed24af7ef9e5e7055
2020-10-13 01:14:25 +00:00
Linus Tufvesson
14c9e48273 Update javadoc for setLaunchDisplayId am: 334190f26e am: c37e102250
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12794770

Change-Id: I57cce60a4f3c34b00f2c215e49cde51b0daf11bd
2020-10-09 21:42:16 +00:00
Linus Tufvesson
334190f26e Update javadoc for setLaunchDisplayId
.. to match behavior post I1f9662c2bd14b34e00fbc8ebb926538f0329c37a

Bug: 167593637
Test: Javadoc change only.
Change-Id: I4cb9fe4a5ae74b1474f9da39b6aeb3a374f8cf12
2020-10-09 09:54:40 +00:00
TreeHugger Robot
e205d8d04f Merge "Fix the issue provider can be wrong when requesting slice permission" into rvc-qpr-dev 2020-10-05 23:12:06 +00:00
Pinyao Ting
df8bc34ba6 Fix the issue provider can be wrong when requesting slice permission am: e3eba1322b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12687714

Change-Id: Ie3fefe8638c85c5b887b62612cfd5c5a338b827b
2020-10-05 23:01:26 +00:00
Charles Chen
f0daa2119f [RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays" am: ae03031efe am: 6c079ef0b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12716107

Change-Id: I306a382fa9ae3b9abc096c343316365c6a6ce8dd
2020-09-29 06:36:04 +00:00
Charles Chen
6c079ef0b5 [RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays" am: ae03031efe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12716107

Change-Id: If1a42b8cd7cab0c97f45fc3f452dbe4bc054cf41
2020-09-29 06:17:52 +00:00
Charles Chen
5c393cb830 Merge "[RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"" into rvc-dev 2020-09-29 05:59:59 +00:00
Charles Chen
ae03031efe [RESTRICT AUTOMERGE] Revert "Require permission to create trusted displays"
This reverts commit f21c885ca7.

Reason for revert: Have regression b/168268396.
Needs to pull out from Nov. builds.

Bug: 162627132

Change-Id: I29fa3937d1655a0cc7591abcfa2067f4fb2b2bcb
2020-09-29 03:21:52 +00:00
TreeHugger Robot
f7741b10f3 Merge "Revert "Allow package verifier to hide specific fgs notifications."" into rvc-qpr-dev 2020-09-25 17:16:49 +00:00
TreeHugger Robot
d6af5b5d1e Merge "Make process level rotated config and display metrics consistent" into rvc-qpr-dev 2020-09-25 03:54:37 +00:00
Pinyao Ting
4344e63295 Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
2020-09-24 19:10:45 +00:00
Pinyao Ting
e3eba1322b Fix the issue provider can be wrong when requesting slice permission
SlicePermissionActivity reads provider_pkg from intent, which can be
modified at will. As a result user might see incorrect package name in
the dialog granting slice permission.

Bug: 159145361
Test: manual
Merged-In: I8b66c02786df4096dad74b7e76255d5ddd1d609d
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
(cherry picked from commit 0ad32a2d70)
2020-09-24 19:06:07 +00:00
Ryan Mitchell
030e4702d0 Merge "Reduce RM createResources lock contention" into rvc-qpr-dev 2020-09-24 15:26:25 +00:00
Riddle Hsu
6bb2b9c716 Make process level rotated config and display metrics consistent
The application may get Resources instance from Resources.getSystem()
and context.getApplicationContext().getResources(). Since fixed
rotation is introduced that allows an activity to start in a different
rotation than the current display, when using getConfiguration() and
getDisplayMetrics() of these Resources instances, the orientation
and metrics need to be the same as current display is rotated.
Otherwise the app may show unexpected UI layout.

Although it is not recommended to use global resources/config for
activity. One of the goal of fixed rotation transform is to simulate
the app is started in a rotated environment, so this CL makes the
configuration and display metrics of system resources are consistent
with application and activity for compatibility.

About WindowProcessController and ActivityStackSupervisor:
 The process configuration passed to LaunchActivityItem may be
 associated from activity. if the sequence number of configuration
 is overridden by activity, the configuration may be ignored when
 launching the activity because the sequence number isn't larger
 than the previous process configuration. Although there will be a
 ConfigurationChangeItem later to update correct state, the app may
 get the intermediate state with old configuration and metrics.

About ResourcesManager and DisplayAdjustments:
 There are 2 new fields appWidth and appHeight added to
 DisplayAdjustments#FixedRotationAdjustments because the display
 metrics from Resources.getSystem() is independent from activity
 configuration. Only window manager knows the rotated size, so
 the values need to send to client and then ResourcesManager takes
 the adjustment to change the global display metrics.

About WindowToken:
 When fixed rotation is applied on the token, send the
 FixedRotationAdjustmentsItem first so the later configuration
 change can pick the adjustment at ActivityThread. And because the
 registration of activity configuration only occurs on add/remove
 activity, if it is only switching to another existing activity in
 different orientation, the process configuration still needs to
 be updated.

About ActivityThread:
 The code flow for a rotated activity (DA = display adjustments):
 - Launch new activity
    handleLaunchActivity: override app DA
     handleConfigurationChanged: adjust global display metrics by DA
     performLaunchActivity
      createBaseContextForActivity: override activity DA
 - Resume existing activity
    handleFixedRotationAdjustments: override app and activity DA
    handleConfigurationChanged: adjust global display metrics by DA
    handleResumeActivity

Also some minor corrections:
- Fix wrong display metrics adjustment that xdpi and ydpi should
  not be swapped because they are physical attributes.

Bug: 167564038
Test: atest DisplayAdjustmentsTests
      AppConfigurationTests#testRotatedInfoWithFixedRotationTransform
      WindowProcessControllerTests#testProcessLevelConfiguration
      DisplayContentTests#testApplyTopFixedRotationTransform

Change-Id: I60bedc7e09f54683d5e857ccc51402d5d144cd9e
Merged-In: I60bedc7e09f54683d5e857ccc51402d5d144cd9e
2020-09-24 15:09:51 +08:00
Kweku Adams
44baf28ffd Revert "Allow package verifier to hide specific fgs notifications."
This reverts commit e49aa726f0.

Reason for revert: We've decided not to have this in the QPR.

Bug: 164440539
Change-Id: I72ca946f1a5be937b3f3bed746e4251fa9257891
Merged-In: I72ca946f1a5be937b3f3bed746e4251fa9257891
2020-09-23 21:42:14 +00:00
Jay Aliomer
3e605760ed DarkMode Tile affects all users + security bug
When setNightModeActivated is called, the change affects the current logged in user
Also, permission checks are made before changing dark theme
Test: manual
Bug: 168039904
Merged-In: I7786d9dde10f7547f5dd9fb00661fb89fde9f05c
Change-Id: I7786d9dde10f7547f5dd9fb00661fb89fde9f05c
(cherry picked from commit f16e87a992)
2020-09-23 18:03:16 +00:00
Ryan Mitchell
07ef074c6a Reduce RM createResources lock contention
Reduce lock contention for processes that use
ResourcesManager#createResources on background threads by preloading
the apk assets into a temporary cache while the RM lock is not held.

As a result, multiple threads may be performing I/O opening the same
apk assets since multiple threads could be preloading the same apk
at once.

Bug: 111966000
Test: observe significantly less monitor contention with owner bg
      threads calling android.app.ResourcesManager.createResources

Merged-In: Iccf383cb8e1a358af4f71ac242e2216dc5a19ff2
Change-Id: Iccf383cb8e1a358af4f71ac242e2216dc5a19ff2
(cherry picked from commit fb9a011b1d)
2020-09-22 22:34:55 +00:00
Julia Reynolds
71f51c54cd Merge "DO NOT MERGE Revert "Remove app ops indicators from notifications"" into rvc-qpr-dev 2020-09-16 15:09:31 +00:00
Julia Reynolds
8ec5bcb3d0 DO NOT MERGE Revert "Remove app ops indicators from notifications"
This reverts commit 2778b62f1d.

Reason for revert: these icons are still needed

Change-Id: I219af393f3d4cd08e431f38a3b66408e12f258bb
Bug: 163076432
2020-09-16 15:09:03 +00:00
TreeHugger Robot
d3d22be572 Merge "Sanitize more of the notification text fields" into rvc-dev am: ceb7aefd6f am: 6367b4800e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12512483

Change-Id: I227eebd3d4e88a07398a0ca6d140692af7dea3fb
2020-09-10 00:37:54 +00:00
TreeHugger Robot
ceb7aefd6f Merge "Sanitize more of the notification text fields" into rvc-dev 2020-09-09 23:55:10 +00:00
Julia Reynolds
a19f9ed2b1 Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-03 19:42:23 +00:00
Julia Reynolds
8061246d4a Sanitize more of the notification text fields
Test: manual; monitor SystemUI performance when an app tries to
post a messaging style notification with messages with long text
Bug: 158304295
Bug: 147358092

Merged-In: c953fdf6bc
Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
(cherry picked from commit c953fdf6bc)
2020-09-03 19:39:55 +00:00
Andrii Kulian
ef7b1333f0 Require permission to create trusted displays
Bug: 162627132
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/bubbles
Test: atest DisplayTest
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest VirtualDisplayTest#testUntrustedSysDecorVirtualDisplay
Test: adb logcat -b events

Change-Id: Id06b2013ef5fdeadf321f14f8b611c733031d54d
Merged-In: Id06b2013ef5fdeadf321f14f8b611c733031d54d
2020-09-01 05:24:41 +00:00
Andrii Kulian
f21c885ca7 Require permission to create trusted displays
Bug: 162627132
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/bubbles
Test: atest DisplayTest
Test: atest VirtualDisplayTest#testTrustedVirtualDisplay
Test: atest VirtualDisplayTest#testUntrustedSysDecorVirtualDisplay
Test: adb logcat -b events

Change-Id: Id06b2013ef5fdeadf321f14f8b611c733031d54d
Merged-In: Id06b2013ef5fdeadf321f14f8b611c733031d54d
2020-09-01 13:22:29 +08:00
Marco Ballesio
7176835583 Merge changes from topic "cgroup v2 freezer frameworks" into rvc-qpr-dev
* changes:
  freezer: reentrant enable/disable method
  freezer: switch to cgroup v2 freezer
2020-08-28 17:49:06 +00:00
Marco Ballesio
12f3e8d6d4 freezer: reentrant enable/disable method
the app freezer state can be toggled in multiple situations when a
debugging tool like heapdump is invoked, or when system_server dumps its
binder connections. All these uses are potentially concurrent and a
robust method to handle reentrancy is necessary to avoid leaving the
freezer in a state incompatible with a specific operation.

This patch moves freezer enable and disable operations from Process to
CachedAppOptimizer (ActivityManager), introduces a new ActivityManager API
to centralize all freezer state changes to ActivityManager and modifies
client code accordingly.

Bug: 151225245
Test: manually verified that no regression are introduced on freezer
behavior, verified that concurrent behavior is handled properly

Change-Id: I7d588cc6e0499012dce64ed4e42ff2adb336062d
Merged-In: I7d588cc6e0499012dce64ed4e42ff2adb336062d
2020-08-27 16:05:57 -07:00
Charles Chen
b699ff316b Merge "[RESTRICT AUTOMERGE] Make a context dervied from an UI context as an UI context" into rvc-qpr-dev 2020-08-27 16:53:29 +00:00
Charles Chen
c5ba62307c Merge "Respect UI Context for getDisplay" into rvc-qpr-dev 2020-08-27 02:52:05 +00:00
Hongwei Wang
02c5ea670f Merge "[DO NOT MERGE] Sync app requested orientation on PiP exit" into rvc-qpr-dev 2020-08-27 01:29:35 +00:00
Hongwei Wang
a2673cdfd4 [DO NOT MERGE] Sync app requested orientation on PiP exit
When exiting PiP to fullscreen, SysUI compares the initial rotation
with the screen rotation and skips the animation if they are different,
with the intention that the app should get back to its state prior to PiP.

This generally works well except that app may request
setRequestedOrientation after entering PiP and the initial rotation
SysUI gets in onTaskAppeared would be obsoleted.

This is fixed in this CL by
- Adding a requestedOrientation field in TaskInfo to pass this
  information to SysUI, in both onTaskAppeared and onTaskInfoChanged
  callbacks
- Sync with the requested orientation as well as display rotation on PiP
  exit. Moves also the information we need into PipWindowConfigurationCompact

Video: http://rcll/aaaaaabFQoRHlzixHdtY/gOPXfx5KO9krmzeor49DgG
Bug: 163218295
Test: See video
Change-Id: Idd0b9412dfdfd6fd293a800cded7c7a6b94cafde
2020-08-26 16:06:31 -07:00
Hongwei Wang
5460282793 Remove entry from mLastReportedWindowingMode on destroy
Bug: 166456665
Test: atest ActivityLifecyclePipTests \
            ActivityLifecycleSplitScreenTests \
            ActivityLifecycleTopResumedStateTests \
            PinnedStackTests\
            SplitScreenTests \
            ActivityLifecycleKeyguardTests
Change-Id: If2cf664bdb62ac3082c02d2c6c1ad74b10761f62
2020-08-26 09:52:46 -07:00
Charles Chen
b2444cbef5 [RESTRICT AUTOMERGE] Make a context dervied from an UI context as an UI context
fixes: 165833103
Test: atest StrictModeTest ContextAccessTest
Test: atest InputMethodServiceTest InputMethodServiceStrictModeTest

Merged-In: Ia97e1a0cc290be516d2618148600238b3273c54c
Change-Id: Ia97e1a0cc290be516d2618148600238b3273c54c
2020-08-26 11:47:08 +08:00
Narayan Kamath
046d6480cc Merge "AppOpsManager: Add OP_RECORD_AUDIO_HOTWORD" into rvc-qpr-dev 2020-08-25 09:24:11 +00:00
TreeHugger Robot
4cb7d8c878 Merge "fix app prediction service doesn't clean-up properly." into rvc-qpr-dev 2020-08-24 18:27:26 +00:00
Narayan Kamath
68b3c98e14 AppOpsManager: Add OP_RECORD_AUDIO_HOTWORD
Bug: 162547999
Test: make
Change-Id: I1d072d93cb2e2b021b58d37d9340f8298acffa1b
2020-08-24 17:17:52 +01:00
Charles Chen
a4f73d7f1f Respect UI Context for getDisplay
Before InputMethodService initializes, InputMethodService#getDisplay
will throw UnsupportedOperationException because it doesn't attach to
any display. However, it may make developers confuse about why
throwing exception for an UI context. This CL workarounds to also
check isUiContext flags to make the result of IMS#getDisplay consistent.
It should be considered to remove after IMS migrate to WindowContext
concept.

fixes: 161964893
Test: atest InputMethodServiceTest#testGetDisplayBeforeInitialization

Change-Id: Ie0bda707f0196b45a8851f645da7ecab6814bed6
2020-08-24 14:45:02 +08:00
Philip P. Moltmann
732608a6be Add app-ops for camera/mic use during phone call
Test: Started a phone call, verified app-op was active
Bug: 162547999
Change-Id: I93bf59d24e3cfbeaede442571f09ba97f0990c75
2020-08-19 20:17:29 -07:00
Kweku Adams
1706f9c22f Merge "Allow package verifier to hide specific fgs notifications." into rvc-qpr-dev 2020-08-19 17:14:33 +00:00
Kweku Adams
e49aa726f0 Allow package verifier to hide specific fgs notifications.
The package verifier performs some system critical work that the user
doesn't need to be explicitly aware of. This adds a mechanism for the
verifier to indicate which foreground service notifications should be
hidden, if possible.

Bug: 164440539
Test: use test app to confirm requested fgs notifications are hidden
Change-Id: Ib3eb0b71cc676c145557ade9def98a363e5abebb
2020-08-18 10:32:58 -07:00