Commit Graph

10542 Commits

Author SHA1 Message Date
Jimmy Shiu
4c6e5036b7 ADPF: PerformanceHintManager API implementation
Test: Manual test, run bouncy ball
Test: atest FrameworksCoreTests:android.os.PerformanceHintManagerTest
Bug: 158791282
Change-Id: Ia0bf2b06675b8cf57cdf1668ee90e98026416439
Signed-off-by: Wei Wang <wvw@google.com>
2021-04-10 10:21:17 -07:00
Gavin Corkery
072ef5624b Merge "Move REBOOT_READY broadcast into android.scheduling" into sc-dev 2021-04-09 17:17:38 +00:00
Winson Chiu
d08ba27a5f Merge changes I2cf2e739,I9e4bd242,Ic8b93a8c,Ibccde458,I04942e14, ... into sc-dev
* changes:
  Fix domain verify restore and add signature check
  Support serializing package signatures for domain verification state
  Add domain verification CTS to TEST_MAPPING
  Fix DomainVerificationService deadlock
  Check installed and enabled state for package domain approval
  Revoke domain user selection when approved through shell
2021-04-09 17:05:50 +00:00
Svetoslav Ganov
ae4d48ebec Merge "Add AR intent to ingest exempt attribution tags" into sc-dev 2021-04-09 15:31:00 +00:00
Svet Ganov
0d6d9f972e Add AR intent to ingest exempt attribution tags
bug: 179069158

Test: atest CtsActivityRecognitionTestCases

Change-Id: I3fa454351a586cc5d408217a2c1382048e6031e4
2021-04-09 15:29:18 +00:00
Bernardo Rufino
9e9669ea8d Merge "Allow accessibility services to send Intent.ACSD" into sc-dev 2021-04-09 15:13:17 +00:00
Charles Chen
c22aff4e4d Merge "Allow config context to inflate views" into sc-dev 2021-04-09 06:56:16 +00:00
TreeHugger Robot
44763d1b5b Merge "Deprecate unuses installer auto revoke whitelist api" into sc-dev 2021-04-08 21:14:38 +00:00
Sahana Rao
1e98cff664 Merge "Rename requestOptimizedExternalStorageAccess to more precise name" into sc-dev 2021-04-08 15:42:12 +00:00
Oli Lan
4d736b92f3 Merge "Use a DeviceConfig property for the default value of the clipboard notification setting." into sc-dev 2021-04-08 11:31:12 +00:00
Paul Hu
3347a6c3db Merge "Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager" am: ed4117ff40 am: d40e17099f am: 52b8921820
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667080

Change-Id: I5fd350d67065211b84dbea769d258daff9780276
2021-04-08 07:48:14 +00:00
TreeHugger Robot
46d03f1574 Merge "Updating Java doc for FLAG_ACTIVITY_RESET_TASK_IF_NEEDED" into sc-dev 2021-04-08 05:10:35 +00:00
Eugene Susla
ef3dc74a53 Deprecate unuses installer auto revoke whitelist api
Bug: 181344542
Test: presubmit

Change-Id: Ie5032e09cfe426a7611534afc4c7b4fac531018b
2021-04-07 12:45:09 -07:00
Svetoslav Ganov
640b18bd38 Merge "Add fallback for datasource without UPDATE_APP_OP_STATS" into sc-dev 2021-04-07 16:38:25 +00:00
TreeHugger Robot
402eb6529d Merge "Remove annotations from generated class until tests updated" into sc-dev 2021-04-07 16:20:32 +00:00
Bernardo Rufino
19a613c3da Allow accessibility services to send Intent.ACSD
For targetSdk < S. For S, they can use the new
GLOBAL_ACTION_DISMISS_NOTIFICATION_SHADE action to dismiss the
notification shade.

Bug: 159334261
Test: Send Intent.ACSD from an a11y service and verify shade is
      collapsed when targetSdk < S, and exception thrown when targetSdk
      S+.
Change-Id: I0e4be3faef8efa53a0b8a08263e842e0c4b1553e
2021-04-07 15:26:05 +01:00
Charles Chen
d12be75275 Allow config context to inflate views
Besides UI contexts, the context created via
Context#createConfigurationContext with a proper configuration
should be allowed to inflate views or obtain ViewConfiguration.
An example is that a wear device inflate views into bitmap and pass
the bitmap to the Wear OS Companion app on the phone.

Bug: 177847640
Test: atest StrictModeTest

Change-Id: Iab232a80a973f54bf0484262d45af3e4c2f0e5dc
2021-04-07 21:58:42 +08:00
paulhu
b4e9b2b3d8 Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager
- As API review feedback, move ACTION_CLEAR_DNS_CACHE form Intent
  to ConnectivityManager.

- Rename to "android.net.action.CLEAR_DNS_CACHE" because of lint
  suggestion.
frameworks/base/packages/Connectivity/framework/src/android/net/
ConnectivityManager.java:449: error: Inconsistent action value;
expected `android.net.action.CLEAR_DNS_CACHE`, was
`android.intent.action.CLEAR_DNS_CACHE` [ActionValue]

Bug: 183937999
Test: atest FrameworksNetTests
Test: atest ActivityTaskManagerServiceTests
Test: atest android.permission2.cts.PermissionPolicyTest
Test: atest CtsNetTestCases
Change-Id: Iae8aa0ba10dfc7581f0cfaab82643edbee789e2f
2021-04-07 19:40:47 +08:00
Svet Ganov
79db6e5807 Remove annotations from generated class until tests updated
Codegen is a tool that generates parcelable classes from
field declarations. Hence, the @SystemApi annotations are
placed on the field and the tool propagetes them to the
generated APIs. We need to update the AnnotationTest to
either ingore these generated classes or ignore private
fields annotated with @SystemApi as they are not API in
practice. This CL removes the annotations to fix the test.

bug: 184086213

Test: atest android.signature.cts.api.AnnotationTest

Change-Id: Ibe9059f20d95d4cda4eb402704e3c4c002ff0e47
2021-04-07 09:06:20 +00:00
Jeff Chang
84b8ab7302 Merge "Add more OWNERS coverage" am: a40fbcd94c am: 018eaf4357 am: 19840369e1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1531866

Change-Id: I0475257e967bf380f3e12cca62eaf4e094442204
2021-04-07 08:16:09 +00:00
Jeff Chang
a40fbcd94c Merge "Add more OWNERS coverage" 2021-04-07 05:57:30 +00:00
Svet Ganov
773862fda5 Add fallback for datasource without UPDATE_APP_OP_STATS
If the datasource is not in a trusted platform component then in would not
have UPDATE_APP_OPS_STATS. The problem is that an app is exposing runtime
permission protected data but cannot blame others in a trusted way which
would not properly show in permission usage UIs. As a fallback we are
adding a proxy op handling blaming the datasource and the caller.

bug: 183960997

Test: Assustant on auto projection works

Change-Id: I8a341a6c46c75eff86bac7a79c4219ebb7991071
2021-04-07 01:52:14 +00:00
TreeHugger Robot
72a949ba80 Merge "Revert "Revert "Avoid running RegisteredServicesCache tasks on main thread""" into sc-dev 2021-04-06 19:56:31 +00:00
Sahana Rao
d40f9b61a5 Rename requestOptimizedExternalStorageAccess to more precise name
When apps use requestOptimizedExternalStorageAccess flag, they get
additional performance benefit by bypassing database operations. They
still have to scan the file to update MediaStore collection otherwise
MediaStore collection can go inconsistent with lower file system.
Current flag name could lead to apps making wrong assumptions hence
changing the name to more precise name.

Bug: 178209446
Test: atest packages/providers/MediaProvider
Change-Id: I00747da9ea53566cbcdd8aa8b2195e536b397b67
2021-04-06 16:04:50 +01:00
Todd Kennedy
b9f3d0c9fb Revert "Revert "Avoid running RegisteredServicesCache tasks on main thread""
This reverts commit 968b2db0f4.

Reason for revert: Not cause of b/184141588

Change-Id: I9f886e3912dce8c68fee9376f010cd251889b97b
2021-04-06 14:18:21 +00:00
TreeHugger Robot
20d6212568 Merge "Remove a module-lib API" into sc-dev 2021-04-06 10:09:50 +00:00
Aaron Huang
46d99ea11f Expose Context#PAC_PROXY_SERVICE as module lib API
(cherry-picked from ag/14097767)
Bug: 183938000
Test: make update-api
Merged-In: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
Change-Id: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
2021-04-06 17:06:03 +08:00
Aaron Huang
6b759b7c04 Merge "Expose Context#PAC_PROXY_SERVICE as module lib API" into sc-dev 2021-04-06 07:26:01 +00:00
Aaron Huang
62718c2bbf Expose Context#PAC_PROXY_SERVICE as module lib API
Bug: 183938000
Test: make update-api
Change-Id: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
2021-04-06 11:50:21 +08:00
Todd Kennedy
25cca35d93 Merge "Use the correct method to unparcel the property map" into sc-dev 2021-04-05 21:10:15 +00:00
Todd Kennedy
a939273859 Use the correct method to unparcel the property map
We were writing the map as a generic Map, but reading it as an
ArrayMap. There's a subtle difference between the two methods.
The generic Map creator reads the map's key using readValue(),
which first reads an integer datatype and then the data. Whereas
the ArrayMap creator knows the keys are Strings and thus calls
readString() directly without consuming the datatype. This
throws the parcel reading logic out of whack.

Fixes: 176295431
Test: manual
Change-Id: I2d32488e3339e2d838e680be1ed9476b9e15cd69
2021-04-05 10:19:31 -07:00
Winson
091a4e9d05 Add domain verification CTS to TEST_MAPPING
Bug: 178424377

Test: atest CtsDomainVerificationDeviceTestCases
Test: atest CtsDomainVerificationHostTestCases

Change-Id: Ic8b93a8c5e9d0eb69262ec6bc7a196639d06b272
2021-04-02 15:48:18 -07:00
Winson
5f5d4f6071 Check installed and enabled state for package domain approval
If the package isn't installed or isn't enabled for a user, it cannot
be approved for that user.

Also hooks into package uninstall for a single user to remove the
domain state for that package for that user.

Bug: 183226822

Test: atest DomainVerificationManagerApiTest#getOwnersForDomain
Test: atest com.android.server.pm.test.verify.domain

Change-Id: I04942e1491d470fdd41e99f207bbf85baae87d4c
2021-04-02 15:48:18 -07:00
Svet Ganov
48801b0bbd Hookup renounced permissions
Propagate renounced permissions from context params
to the context attribution source. Throw if one
tries to request at runtime a renounced permission.

Also make the AttributionSource take null for the
setters to ease usage, otherwise folks should always
check for null before calling a builder method.

Additionally, we allow apps that have UPDATE_APP_OPS_STATS
to register arbitrary trusted AttributionSource for
testing. Note that this permission allows abritrary app
op operations, thus we are not relaxing the security
model.

bug: 158792096

Test: atest CtsPermission5TestCases

Change-Id: I4330684bb8695fb998cf31e9363b94ad981ba2cc
2021-04-02 17:30:10 +00:00
TreeHugger Robot
bfe78e7308 Merge "Revert "Avoid running RegisteredServicesCache tasks on main thread"" into sc-dev 2021-04-02 01:55:01 +00:00
Todd Kennedy
968b2db0f4 Revert "Avoid running RegisteredServicesCache tasks on main thread"
This reverts commit 8f35d505ba.

Reason for revert: possibly b/184141588

Change-Id: I8c6262ec8ce5561f8d398a81492b6f5217dba834
2021-04-01 21:08:54 +00:00
Chris Li
212351e022 Merge "Update javadoc for FORCE_RESIZE_APP" into sc-dev 2021-04-01 20:28:56 +00:00
Tom Natan
b539e01c8b Merge "Mark force resize/non-resize changes as @Overridable" into sc-dev 2021-04-01 19:54:26 +00:00
Ryan Mitchell
d4f0220d29 Merge "Use staging-public-group in framework SDK" into sc-dev 2021-04-01 18:36:33 +00:00
Ryan Mitchell
ca3b4f7633 Use staging-public-group in framework SDK
To make S finalization easier, this changes the framework SDK so that
apps linking against it will be able to continue working as expected
after the first phase of SDK finalization.

During the first phase of SDK finalization, the resource ids of
resources that have not been removed are finalized.
staging-public-group tags are converted to staging-public-group-final
tags in order to encode into the framework what the staged resource id
of a finalized resource was. When an app recompiles, it will use the
finalized resource id. Then after all apps recompile, phase 2 of
finalization begins, in which the staging-public-group-final tags are
removed so apps can no longer use the staged resource ids.

Apps that link against the SDK (provided they are using a recent
version of aapt) will encode references to staged resources as
TYPE_DYNAMIC_REFERENCE and TYPE_DYNAMIC_ATTRIBUTE. The values of R
fields for staged resources are defined out-of-line to prevent them
from being inlined into apps linking agsint the SDK. This allows the
resource ids to change during phase 1 of API finalization.

Bug: 183413192
Test: `aapt2 diff` and resource ids stayed the same
Test: `aapt2 dump` of framework-res.apk and observe staged resources
Change-Id: Ie2275c608297a5f63dde8b1cf795415112cbcc24
2021-03-31 23:04:57 -07:00
Jeff Sharkey
3076233c8a Merge "Continue populating legacy data structures." into sc-dev 2021-03-31 19:35:27 +00:00
Ryan Mitchell
b1e62648bf Merge "Remove ApkAssets access in finalizer" into sc-dev 2021-03-31 19:21:57 +00:00
Ryan Mitchell
9ff600f60a Remove ApkAssets access in finalizer
ResourcesProvider#finalize called ApkAssets#close. ApkAssets#close is
called during ApkAssets#finalize. If a ResourcesProvider and its
corresponding ApkAssets are finalized concurrently, there may be a
chance that the ApkAsset could be finalized first and then
ResourcesProvider calls ApkAssets#close on the object that has already
been finalized.

This may not fix the bug, but there is no reason to close the ApkAsset
during finalization of the ResourcesProvider.

Bug: 159041693
Test: none
Change-Id: I317ca982df2e11a18ccd6c95c74565dbac417bd6
2021-03-31 09:59:34 -07:00
Jeff Sharkey
2d9355bc44 Continue populating legacy data structures.
Previous work implemented getRequestedPermissions() by dynamically
constructing the legacy list of requested permissions, along with a
deprecation message to migrate to ParsedUsesPermission, but there
are too many callers to migrate at this stage of the release.

For now, to mitigate performance issues that arose, this change
builds a parallel list of requested permissions to avoid the
overhead of dynamically building the legacy list.

Bug: 183223056
Test: atest FrameworksServicesTests:PackageParserTest
Test: atest com.android.server.pm.parsing
Test: atest -p core/java/android/content/pm \
            core/java/com/android/internal/content \
            services/core/java/com/android/server/pm \
            services/tests/servicestests/src/com/android/server/pm
Change-Id: I538fbc12a9fd34f5ad5d63177ac5a2cb9a1ff3ce
2021-03-31 14:19:33 +00:00
JW Wang
9fcfccbcc0 Remove a module-lib API
Per b/150347230#comment18, remove the API since
RollbackManager will not be a module in S.

Bug: 150347230
Test: m
Change-Id: I1f356d0f5097da340986182314e47e3b6b6d9223
2021-03-31 18:17:05 +08:00
Paul Hu
dbb6403a1a Merge "Add documents for isOem/Vendor/Product" am: 67b816def6 am: 1593239f22 am: 055f044724
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1657399

Change-Id: I919cb5686b00247e8b3f158b2a881fb21f87651b
2021-03-31 08:42:31 +00:00
Jeff Chang
663709f12f Add more OWNERS coverage
Bug: 123083574
Test: build
Change-Id: I912ad002d40f19944946ac650add8547ad7bc248
2021-03-31 14:49:32 +08:00
Svet Ganov
623ff43bda Fix NPE in PermsissionChecker
Also added some logging for runtime permissions with no app op

bug: 184093962

Test: Setting up device with work account

Change-Id: I85787367b11d57ed1240fcf484ad7d2efa13d406
2021-03-31 03:27:51 +00:00
Chris Li
f37505f273 Update javadoc for FORCE_RESIZE_APP
As we allow non-resizable app in multi-windowing mode, the previous
comment can be confusing.

Bug: 176061101
Test: udpate comment
Change-Id: Iba51ca4158940bbda761fe3b7977d338ee1f3327
2021-03-30 19:33:55 -07:00
Svet Ganov
7d058d62e5 Addressing comments from commit:8d2ed5
bug:158792096
bug:180647319
bug:184051153
bug:184027531

Test:atest CtsPermissionTestCases
     atest CtsPermission2TestCases
     atest CtsPermission3TestCases
     atest CtsPermission4TestCases
     atest CtsPermission5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases
     atest CtsAlarmManagerTestCases

Change-Id: Id324ed0e2a653dface6ba273bba27e92bea14f99
2021-03-31 02:11:46 +00:00