Commit Graph

18969 Commits

Author SHA1 Message Date
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
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
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
Lee Shombert
3da8ca16f4 Reduce auto-cork delay to 50ms
Bug: 160971853

Reduce the auto-cork delay from 2s to 50ms.  Testing shows that this
introduces a very few new invalidate calls for the package_info cache
key, and greatly improves the hit ratio for the associated caches.

This change includes a fix to the cache-clear counter.  Some clears
were missing.

Test:
 * phone reboot
 * atest CtsContactsProviderTestCases
 * atest FrameworksServicesTests:UserSystemPackageInstallerTest
 * atest FrameworksServicesTests:PackageManagerSettingsTests
Verified that hit ratios improved over the baseline.  Verified that the
number of extra invalidates did not increase by more than 5.

Change-Id: I4b70b1da8c3927c74077e6da0e60dc56c2e007f1
2020-08-17 16:29:14 +00:00
David Srbecky
82968c5f2d Merge "Revert "Introduce ActivityTransactionItem and reduce null checks"" 2020-08-17 11:48:07 +00:00
David Srbecky
fd2be2c178 Revert "Introduce ActivityTransactionItem and reduce null checks"
This reverts commit 9b1e955021.

Reason for revert: Breaks many tests

Bug: 164982975
Change-Id: I86e7b158ae593aab6d73950bbb2b9dc6a7d5093c
2020-08-17 11:42:35 +00:00
Julia Reynolds
d3dc8e79cf Merge "Remove app ops indicators from notifications" into rvc-qpr-dev am: 2659836775
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12361488

Change-Id: I70c1dd2665b51c442484577f0077ad4bebc0577d
2020-08-14 17:43:43 +00:00
Julia Reynolds
2778b62f1d Remove app ops indicators from notifications
Test: atest
Bug: 163076432
Change-Id: I5b7514f765811ffd3b0aca63d0108591755974ab
Merged-In: I5b7514f765811ffd3b0aca63d0108591755974ab
2020-08-14 15:02:02 +00:00
Julia Reynolds
f9239b3afc Merge "Remove app ops indicators from notifications" 2020-08-14 13:17:42 +00:00
TreeHugger Robot
8d0e4c5515 Merge "Introduce ActivityTransactionItem and reduce null checks" 2020-08-14 05:05:42 +00:00
Jin Seok Park
47d658445c Merge "[Media ML] Replace observing changes in Settings value" 2020-08-14 01:42:18 +00:00
Steven Moreland
eee71ccc12 Merge "ApplicationLoaders: improve classloader cache errs" am: 6bfe7f9a26 am: bf9f6b4f3b am: 96894457f7 am: dda9aa4f65 am: 17094702af
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1399628

Change-Id: I27603c56d50b6d59d25a61a81ccdd74ffd157b7f
2020-08-13 23:23:31 +00:00
Steven Moreland
17094702af Merge "ApplicationLoaders: improve classloader cache errs" am: 6bfe7f9a26 am: bf9f6b4f3b am: 96894457f7 am: dda9aa4f65
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1399628

Change-Id: Ib3d2e32ba6c0130fa07475c9c25c1a63b76d9ce7
2020-08-13 23:04:24 +00:00
Steven Moreland
96894457f7 Merge "ApplicationLoaders: improve classloader cache errs" am: 6bfe7f9a26 am: bf9f6b4f3b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1399628

Change-Id: Ie9c4dafb0ac9ad965dd51b9b789d2d41a7606a5d
2020-08-13 22:28:19 +00:00
Steven Moreland
1997524011 ApplicationLoaders: improve classloader cache errs
When zygote preloads a classloader, but at runtime, a different one is
used, we get an error and fallback. This error is improved in the
following ways:
- print the zip name with the shared libraries, so we know which library
  the error is for
- distinguish cached from runtime dependencies in the error message
  itself

Bug: 163886868
Test: N/A
Change-Id: I3f4c4078e9eb05b83058982afc7b7ea0822d1257
2020-08-13 17:07:34 +00:00
Jin Seok Park
643f3e419e [Media ML] Replace observing changes in Settings value
Currently, MediaSessionService observes the
ENABLED_NOTIFICATION_LISTENERS value in Settings to be notified
when a previously "enabled" NotificationListener becomes "disabled".

Instead, this CL adds a new broadcast intent action that
NotificationManagerService can use to notify MediaSessionService
whenever the enabled value of a notification listener changes.

Bug: 160762852, Bug: 147019349
Test: Go to Settings > Apps & Notifications > Special app access
    > Notification access
    and check if allowing/disallowing Notification access for any
    app causes onEnabledChanged to be called.
Change-Id: I3aefa40083fedb78214ae884c7cccaf8de206663
2020-08-14 01:10:31 +09:00
Julia Reynolds
3a72daad2b Remove app ops indicators from notifications
Test: atest
Bug: 163076432
Change-Id: I5b7514f765811ffd3b0aca63d0108591755974ab
2020-08-13 11:33:43 -04:00
Joanne Chung
400379c26f Merge "Add TEST_MAPPINGs for autofill in Activity path" 2020-08-13 06:02:39 +00:00
TreeHugger Robot
fab755105a Merge "PackageNamePermissionQuery uid->userId" 2020-08-12 20:59:23 +00:00
TreeHugger Robot
4574c50b47 Merge "Fix the issue provider can be wrong when requesting slice permission" 2020-08-12 17:12:12 +00:00
Joanne Chung
47c1accb59 Add TEST_MAPPINGs for autofill in Activity path
Autofill broken tests (b/162203720) that weren't executed in the
presubmit. Add the fail tests into TEST_MAPPING to make sure tests
can be tested in presubmit.

Bug: 154961272
Test: atest --test-mapping frameworks/base/core/java/android/app/
Test: TreeHugger
Change-Id: Ifaefa6fae08d698b770e43830a62b3afb5b4edc5
2020-08-12 14:58:49 +00:00
TreeHugger Robot
dc7aab9ecb Merge "AM.setProcessMemoryTrimLevel: uid -> userId name" 2020-08-12 03:06:36 +00:00
Adam Bookatz
833fe586e6 PackageNamePermissionQuery uid->userId
PackageNamePermissionQuery (and all that uses it) speaks
of uid, but it actually stores/queries a userId. We therefore
rename the variable/parameter from uid to userId, as appropriate.

Bug: 163651060
Test: still compiles (no functional changes were made)
Change-Id: I3db2263a3f960d7eda35466a2e9058fe6f27e49a
2020-08-12 01:37:51 +00:00
Andrii Kulian
6e61790d80 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

Change-Id: Id06b2013ef5fdeadf321f14f8b611c733031d54d
2020-08-12 01:12:54 +00:00
Jing Ji
63dd037e09 Merge "Move the waiting for the publishing of content provider to client side" 2020-08-12 00:03:27 +00:00
Adam Bookatz
c2d27df960 AM.setProcessMemoryTrimLevel: uid -> userId name
The name of the parameter should be userId, not uid.
All callers and implementations seem to use userId.

Test: compiles
Bug: 163626967
Change-Id: I5a733075f8a0f19b44c01f65221c04694a178e0c
2020-08-11 16:57:09 -07:00
Pinyao Ting
0ad32a2d70 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
Change-Id: I8b66c02786df4096dad74b7e76255d5ddd1d609d
2020-08-11 15:31:26 -07:00
Julia Reynolds
7920359f5b Merge "Allow apps to require auth before triggering actions" 2020-08-11 18:34:22 +00:00
TreeHugger Robot
3542f6c0bf Merge "clean-up unrequired slice access from default home app" 2020-08-11 18:34:01 +00:00
Neil Fuller
8164e67726 Change TimeZoneDetectorStrategyImpl to allow geo
Change TimeZoneDetectorStrategyImpl to allow a new "geo only" mode.

The strategy can now exist in one of two modes:
1) Telephony signals only
2) Geolocation signals only

They may later joined by a third "hybrid" mode where we can
experiment with how to blend the two (if that seems like it will provide
better results), or perform a fallback from one to the other.

Note that nothing is actually making Geolocation-based suggestions yet.
The shell command line can be used to simulate geolocation suggestions
in the meantime.

This commit doesn't contain real settings logic: the settings storage and
logic will be added in a follow-up commit.

Bug: 149014708
Test: atest com.android.server.timezonedetector
Test: atest core/tests/coretests/src/android/app/timezonedetector/
Change-Id: I83f8f64d40255567c035a67741b18ecaf6f0561d
2020-08-11 14:25:38 +01:00
TreeHugger Robot
4676898b8d Merge "Fix the save UI does not restore" 2020-08-11 12:00:08 +00:00
Ruslan Tkhakokhov
e18f95849d Merge "[FSD2D]: Ignore eligiblity checks in BackupAgent" 2020-08-11 11:47:34 +00:00
Ruslan Tkhakokhov
3567b842e7 [FSD2D]: Ignore eligiblity checks in BackupAgent
In case of device-to-device migration:
1. Include no-backup and cache dirs.
2. Ignore restore eligibility check for file paths.

Bug: 160407842
Test: 1. atest BackupAgentTest
      2. Manual: Verify that all files are backed up / restored for
      migrations.
Change-Id: I011c954c3e9e09828d2fb65fdfe96d8b6a6ba150
2020-08-11 11:46:49 +00:00
Julia Reynolds
2a8d8bb7dc Allow apps to require auth before triggering actions
Test: atest; cts in topic
Bug: 162100703
Change-Id: I25354858104eb7fbb343dbb006cd8bf9e48ae3e1
2020-08-10 15:56:11 -04:00