Commit Graph

19000 Commits

Author SHA1 Message Date
Jorge Gil
af366411e2 Merge "Add support for explicit Auto Pip" 2020-09-02 20:52:32 +00:00
Wale Ogunwale
9db724816c Add support for explicit Auto Pip
Adds a new parameter to PictureInPictureParams that
allows activities to explicitly allow the system to
put them in PIP mode without them having to call
enterPictureInPictureMode().

Test: atest PinnedStackTests#testAutoPipAllowedBypassesExplicitEnterPip
Bug: 163048957
Change-Id: Ib6fda0e231408f2756a4e1b9fda08536889a1be5
2020-09-02 11:29:23 -07:00
Julia Reynolds
4f26f3f19f Merge "Sanitize more of the notification text fields" 2020-09-02 15:10:16 +00:00
TreeHugger Robot
182cd692ff Merge "Update Common Criteria mode javadoc" 2020-09-01 15:37:50 +00:00
Marco Ballesio
42310524d6 Merge changes from topic "freezer v2 frameworks to master"
* changes:
  freezer: reentrant enable/disable method
  freezer: switch to cgroup v2 freezer
2020-08-28 16:44:57 +00:00
Rubin Xu
47dd8f97ad Update Common Criteria mode javadoc
Mentions that Wifi configurations will be lost if CC mode is
toggled on then off.

Bug: 165050243
Test: build
Change-Id: I991e1d877592e89c8839d3f8280b5d83710a3f4a
2020-08-28 15:50:36 +01:00
Marco Ballesio
db203fcabf 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
2020-08-27 15:56:51 -07:00
hkuang
3eb57dc580 TranscodingAPI: Expose MediaTranscodeManager as System API.
Bug: 160260102
Test: Unit test
Change-Id: I38e9efc46e23fe1aafe65100bbc7f72eb200720f
2020-08-27 22:20:18 +00:00
Charles Chen
f2fd530d37 Merge "Respect UI Context for getDisplay" into rvc-qpr-dev am: c5ba62307c am: 117b9ab1d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12313930

Change-Id: Ib7ed054c9016abdc348b66e57635998cec91dca2
2020-08-27 07:38:13 +00:00
Charles Chen
117b9ab1d8 Merge "Respect UI Context for getDisplay" into rvc-qpr-dev am: c5ba62307c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12313930

Change-Id: I7d9bfc3f9e1854a3d86a26f905125c71fd9e854c
2020-08-27 03:05:15 +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
9f7f6506c9 [DO NOT MERGE] Sync app requested orientation on PiP exit am: a2673cdfd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12464246

Change-Id: I1d4a9a4d24d781107e86d4400f2e55cdcb113579
2020-08-27 01:43:58 +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
Julia Reynolds
c953fdf6bc 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

Change-Id: I0e2ea12fc3351b1a56645b556720ea2306f5422a
2020-08-26 17:07:53 -04:00
Hongwei Wang
23b4bd372f Remove entry from mLastReportedWindowingMode on destroy am: 5460282793
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12462024

Change-Id: I585dca4ebcd69ad4c31d350eb43045981baa56dd
2020-08-26 18:53:08 +00: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
Pavel Grafov
ab1020f856 Remove unused non-public method.
Bug: 165552960
Test: builds
Change-Id: I9febd312e34d6114131ab0c888484edcf570ad4f
Merged-In: I9febd312e34d6114131ab0c888484edcf570ad4f
(cherry picked from commit 812a2052fb4b1f67b87f8886bafad7a9c03d2574)
2020-08-26 10:33:37 +00:00
Rick Yiu
7bf9789299 Merge "Revert "Let activities can be recreated in ON_START state"" 2020-08-26 10:08:07 +00:00
Rick Yiu
167538021b Revert "Let activities can be recreated in ON_START state"
This reverts commit d3ed35f3e9.

Reason for revert: Droidcop: Potential culprit for Bug 166391370 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Ib6007f01fdaf0ef74e8b630e5e13862f30689ef0
2020-08-26 07:44:33 +00:00
TreeHugger Robot
b0e58545c1 Merge "Let activities can be recreated in ON_START state" 2020-08-26 02:58:16 +00:00
Alex Buynytskyy
af7f8f199e Merge "APK digest API and initial implementation." 2020-08-25 15:38:23 +00:00
Neil Fuller
d7efb1175a Merge "Add explicit TEST_MAPPING files for tz detector tests" 2020-08-25 13:56:55 +00:00
Narayan Kamath
969901251b Merge "AppOpsManager: Add OP_RECORD_AUDIO_HOTWORD" into rvc-qpr-dev am: 046d6480cc am: 6987690464
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12434705

Change-Id: I7fad503f467fd88f778ad4449b7ec2a1b722ec69
2020-08-25 11:05:07 +00:00
Chilun
d3ed35f3e9 Let activities can be recreated in ON_START state
We should also allow the activity to be recreated in ON_START state,
since ON_START is also a resting state and we don't see a reason to
prevent applications from doing so.

Bug: 162906202
Test: atest FrameworksMockingCoreTests
      atest FrameworksCoreTests
      atest WmTests
Change-Id: I20a9c1c25c0b5e1a392b18dc5bac26a1551990e2
2020-08-25 18:43:38 +08:00
Narayan Kamath
6987690464 Merge "AppOpsManager: Add OP_RECORD_AUDIO_HOTWORD" into rvc-qpr-dev am: 046d6480cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12434705

Change-Id: Ib81552912e1013bfc5b344ca94b51d29c3fe6d01
2020-08-25 10:12:53 +00:00
Narayan Kamath
046d6480cc Merge "AppOpsManager: Add OP_RECORD_AUDIO_HOTWORD" into rvc-qpr-dev 2020-08-25 09:24:11 +00:00
Alex Buynytskyy
ec6f3e189c APK digest API and initial implementation.
Bug: 160605420
Test: atest ChecksumsTest

Change-Id: I08ef0b131c44313f2c6acddad00dfa03598cc1ff
2020-08-24 19:54:02 -07:00
Charles Chen
ae905ec585 Merge "Fix lock contention in ResourcesManager" 2020-08-25 01:26:30 +00:00
TreeHugger Robot
adf80b4adc Merge "fix app prediction service doesn't clean-up properly." into rvc-qpr-dev am: 4cb7d8c878 am: e548482d8d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12221409

Change-Id: I5ec77ed5785cd9ac1d2be7007bdff9cad94b0fb3
2020-08-24 21:17:55 +00:00
Neil Fuller
1bb318e04e Merge "Implement user-scoped geolocation configuration" 2020-08-24 19:47:49 +00:00
TreeHugger Robot
e548482d8d Merge "fix app prediction service doesn't clean-up properly." into rvc-qpr-dev am: 4cb7d8c878
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12221409

Change-Id: I880aa857e53bc499837b8cb2c1eeff84137a55be
2020-08-24 18:57:50 +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
Neil Fuller
b1d9bf78ce Add explicit TEST_MAPPING files for tz detector tests
Add explicit TEST_MAPPING files for tz detector tests to include them in
presubmit.

Bug: 149014708
Test: treehugger
Change-Id: I2133280072ce1b65ddcfc620fdee91be7fef32f8
2020-08-24 14:43:05 +00:00
Neil Fuller
a223581eee Implement user-scoped geolocation configuration
Implement user-scoped geolocation configuration / behavior.

The main changes:

1) For simplicity, configuration change listener is no longer passed the
latest config. It is left to the listener to request the latest config.
This removes some of the previous complexity that required a SparseArray
to track listeners by userId.

2) The Callback implementation is now responsible for listening for
configuration / user changes and invoking a listener (which will invoke
other listeners). This is to try to have one class know all the various
settings that affect auto time / geolocation detection behavior, which
has become more complicated with the user-scoped geolocation config. The
TimeZoneDetectorInternal has some listener methods added in preparation
for later steps.

3) The new "geolocation detection enabled" setting is added. This allows
users to selectively disable geolocation time zone detection
independently of the location toggle.

4) The TimeZoneConfiguration now carries the ID of the user it is for,
since it now contains user-specific state.

5) Internally, the TimeZoneConfiguration is replaced by the
ConfigurationInternal class, which includes all properties (not just
user visible settings) that influence time zone behavior on the device.
The ConfigurationInternal generates the TimeZoneCapabilities and
TimeZoneConfiguration.

6) In a change from the initial behavior, any previously received
geolocation suggestion is cleared if geolocation detection is turned
off (or the current user switches to one that has it turned off), and
suggestions received when geolocation detection is off are ignored.
This is trying to be careful to avoid caching the geolocation timezone
if the user has signalled they don't want their device to use it.

Test: atest services/tests/servicestests/src/com/android/server/timezonedetector
Test: atest core/tests/coretests/src/android/app/timezonedetector
Bug: 149014708
Change-Id: Ieac9f8f646e16edcb8b6ea6c8749e45761898ac1
2020-08-24 15:42:00 +01:00
Charles Chen
2de5510bdf Fix lock contention in ResourcesManager
1. Scope dowm synchronized block to mAdjustedDisplays put and get
2. Use SoftReference instead of WeakReference because
   display's weak reference is cleared after getAdjustedDisplay
   returned and the cache didn't take effects previously.

fixes: 162445376
Test: ResourcesManagerPerfTest
Before:
    getDisplayMetrics_median: 3413
    getDisplayMetrics_mean: 3439
    getDisplayMetrics_min: 3364
    getDisplayMetrics_standardDeviation: 107
After:
    getDisplayMetrics_median: 3048
    getDisplayMetrics_mean: 3096
    getDisplayMetrics_min: 2999
    getDisplayMetrics_standardDeviation: 134

Change-Id: I8a5c3ba960c8231aee78b0e7fb958bf6845d5bb5
2020-08-24 16:30:48 +08: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
wilsonshih
283da3bf5f Fixes activity didn't receive windowing mode change while exitPip
When user dismiss pip, WindowOrganizerController#applyChanges would
first try to resize pinned task, this will cause the activity to do
ensureActivityConfiguration and which could trigger configuration
change or relaunch the client activity. However, the windowing mode was
not change yet, so the windowing mode change would be scheduled in
another configuration change to client. But since the windowing mode
is not public, client will treat there is difference so skip that
configuration. To ensure client receive windowing mode change, check it
before check configuration difference.
And in order to prevent the WindowState#reportResized send before
ActivityRelaunchItem send to client, skip resize if we already know
that activity is going to relaunch.

Bug: 165051679
Test: atest ActivityLifecyclePipTests ActivityLifecycleSplitScreenTests
ActivityLifecycleTopResumedStateTests PinnedStackTests SplitScreenTests
ActivityLifecycleKeyguardTests

Change-Id: I7b96bbcf1a71ff75751e14db44c03261862bc857
2020-08-21 05:10:11 +00:00
Darryl Johnson
48f430566d Merge "Don't override config of display contexts with activity display." 2020-08-20 21:47:53 +00:00
Philip P. Moltmann
67cfa22571 Add app-ops for camera/mic use during phone call am: 732608a6be
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12396940

Change-Id: If8cbb6d6535dc1858e475d59ad282b89560c7de7
2020-08-20 19:50:24 +00:00
Darryl L Johnson
3c0078e80f Don't override config of display contexts with activity display.
This change migrates the previous usages of
ResourcesManager#getResources() from using the display id of expected
resources to an override display ID which will override the display
properties from the parent token resources. This ensures that all
contexts derived from a display context keep the overrides for their
intended display.

This also changes the meaning of ResourcesKey#mOverrideConfiguration and
ResourcesKey#mDisplayId. Previously mDisplayId was used as both the
current display of the ResourcesKey and used to apply overrides
to mOverrideConfiguration. This made it unclear whether a particular key
should keep its display override when an activity changes display or
whether it should inherit the new display from the activity. Now the
display IDs and overrides are managed by the ActivityResources struct and the
ResourcesKey is expected to only contain the final display ID expected
for the resources in 'mDisplayId' and the final configuration that should
be applied to the global configuration in 'mOverrideConfiguration'.

Fixes: 153866583
Fixes: 156758475
Fixes: 163813210
Fixes: 163812902
Fixes: 163813227

Test: ActivityThreadTest
Test: ResourcesManagerTest
Test: AppConfigurationTests#testActivityContextDerivedDisplayContextOrientationWhenRotating

Change-Id: If93f98f93ee15b27d8c7292a2f830c2cc0f49277
2020-08-20 10:15:48 -07: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
Philip P. Moltmann
ba266faea5 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 19:43:30 -07:00
Kweku Adams
dcca9929b1 Merge "Allow package verifier to hide specific fgs notifications." into rvc-qpr-dev am: 1706f9c22f am: 769c4f6830
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12378562

Change-Id: I38c2c79c41cb82c432fc904f3923625c1f4216c2
2020-08-19 17:37:47 +00:00
Kweku Adams
769c4f6830 Merge "Allow package verifier to hide specific fgs notifications." into rvc-qpr-dev am: 1706f9c22f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12378562

Change-Id: I49a977a18f40504b7bea8e0280d975cccb18c897
2020-08-19 17:25:05 +00: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
Ryan Mitchell
e3838e88bd Remove ResourcesManager Slog.wtf
LoadedApk.updateApplicationInfo can call getResources while holding the
ResourcesManager lock. Remove the wtf and replace it wuth a debug
warning.

Bug: 165367316
Change-Id: I734688edd4e1d218fd0e2438b47ee05e477aa79f
Test: presubmit
2020-08-18 21:43: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
Charles Chen
d21cb60c0e Merge "Require permission to create trusted displays" 2020-08-18 09:53:42 +00:00