Commit Graph

10603 Commits

Author SHA1 Message Date
Philip Junker
3d123a82e8 Define private manifest flag for home sound exception and add permission am: 0b6eaf12b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13699631

Change-Id: I4015710fb9e2c8e8d50513fc5a78dbb7b3218eeb
2021-03-24 16:24:25 +00:00
Yuncheol Heo
7e6698ef53 Merge "Add Theme.setNewResourcesImpl() method." into sc-dev am: fef662cdcc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13926147

Change-Id: Id9c4ba9a2816f63827046df5327dec257e3a2d88
2021-03-24 15:46:10 +00:00
Yuncheol Heo
fef662cdcc Merge "Add Theme.setNewResourcesImpl() method." into sc-dev 2021-03-24 15:36:17 +00:00
Charles Chen
6287cc3c3b Merge "Add OWNERS for ComponentCallbacksController" am: 4eca6d0c5c am: 06b102a70d am: 0d35481d52 am: b26733e23a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1642179

Change-Id: I9690e5ebaa34a83c39f06f9d488fb05d3936f14c
2021-03-24 12:09:27 +00:00
Charles Chen
b26733e23a Merge "Add OWNERS for ComponentCallbacksController" am: 4eca6d0c5c am: 06b102a70d am: 0d35481d52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1642179

Change-Id: Ie69644a729f2f535366f5e9997bff2c9d58ec782
2021-03-24 11:55:37 +00:00
Philip Junker
0b6eaf12b1 Define private manifest flag for home sound exception and add permission
Test: manual
Test: atest HomeSoundEffectControllerTest
Bug: 167946828
Bug: 157407957
Change-Id: If8278013a7b558e837f3e831fabe8ca3a737aa6e
2021-03-24 11:38:00 +01:00
Charles Chen
4eca6d0c5c Merge "Add OWNERS for ComponentCallbacksController" 2021-03-24 10:05:52 +00:00
Charles Chen
cb0ca7fb0e Merge "Move WindowContext module to window package" into sc-dev am: 1e76f995bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13435723

Change-Id: Ibbd935039dd34ab0b507f6fcf59d572d3eafd2d7
2021-03-24 08:26:42 +00:00
Charles Chen
1e76f995bf Merge "Move WindowContext module to window package" into sc-dev 2021-03-24 07:45:41 +00:00
Sahana Rao
b386d8f31c Merge "Add manifest attribute requestOptmizedExternalStorageAccess" into sc-dev am: 98ffa1355d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13947086

Change-Id: Ice9dd833390a738290644355b9719283b36399dd
2021-03-24 06:05:10 +00:00
Charles Chen
f48ece4875 Move WindowContext module to window package
In this way, we can clarify the owners and it is easier to maintain.
Also refactor to move WindowContext creation logic to ContextImpl.

Test: atest WindowContext WindowContextTests WindowContextPolicyTests
Bug: 159767464
Bug: 152193787

Change-Id: I78432aa18aa97e001f5a9a04321109e456fd137b
2021-03-24 11:26:50 +08:00
Sahana Rao
98ffa1355d Merge "Add manifest attribute requestOptmizedExternalStorageAccess" into sc-dev 2021-03-24 01:31:55 +00:00
TreeHugger Robot
004ad95901 Merge "Convert domain verify dev errors to IllegalArg" into sc-dev am: 3f55bdd6bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13973529

Change-Id: Ie10a01511f97d55787d4de3e56af991dad6b1cb5
2021-03-24 01:20:29 +00:00
Winson
522b9a8b3a Convert domain verify dev errors to IllegalArg
Also adds @CheckResult.

Bug: 180991102

Test: atest DomainVerificationManagerApiTest

Change-Id: I3aad2f920ad07889c4debca1415236699a1845d7
2021-03-23 11:27:09 -07:00
Saumya Pathak
37fc428f52 Merge "Add app clone profile and APIs." into sc-dev am: cbe66b17b9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13709992

Change-Id: If7bb00d9cef3ea19b79da23793747e4a41989dc9
2021-03-23 11:32:35 +00:00
Saumya Pathak
cbe66b17b9 Merge "Add app clone profile and APIs." into sc-dev 2021-03-23 11:15:59 +00:00
Saumya Pathak
5a4fc52fc7 Add app clone profile and APIs.
This change adds a new hidden user type "android.os.usertype.profile.CLONE"
and two new system APIs "isCloneProfile" and "hasSharedMedia". To support App cloning, we need to support sharing media between the owner user and the clone user. Adding this as a property in UserTypeDetails.

Bug: 182396009
Test: atest android.multiuser.cts.UserManagerTest#testCloneUser, atest com.android.server.pm.UserManagerTest#testCloneUser and manually ran shell commands on the clone user.

Change-Id: I49ddcbd499944ca9ec05ef4dc10d2e2b231d8b88
(cherry picked from commit db930667a21dac9f0de7cb2fe99175b3b4545bf4)
2021-03-23 11:15:09 +00:00
Sahana Rao
24734440c0 Add manifest attribute requestOptmizedExternalStorageAccess
Add new manifest attribute requestOptmizedExternalStorageAccess.
When the flag is set, app requests for performance optimisations for
file path operations. Apps get this performance optimisation by
bypassing database operations as part of file path operations. Hence,
when the flag is set, app will be resposible to keep MediaStore database
consistent for its file path operations.

App should hold android.Manifest.permission#MANAGE_EXTERNAL_STORAGE
permission or SYSTEM_GALLERY role, otherwise the flag will be ignored.

The default values is
- True if
* if app has android.Manifest.permission#MANAGE_EXTERNAL_STORAGE
permission and targets targetSDK<=30.
* app has SYSTEM_GALLERY role and targetSDK<=29.
- False otherwise.

Bug: 178209446
Test: atest
android.scopedstorage.cts.device.BypassDatabaseOperationsTest

Change-Id: I951c3001c2b7dbe163b3bfecef4ee8ad350230ae
2021-03-23 09:03:27 +00:00
TreeHugger Robot
ccfc15d63f Merge "Shortcut integration with AppSearch (Part 5)" into sc-dev am: 9081a441dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13554951

Change-Id: Icbcfe9fc8f25357630acf10cf7c4b91c8dbfda09
2021-03-23 06:32:28 +00:00
TreeHugger Robot
9081a441dc Merge "Shortcut integration with AppSearch (Part 5)" into sc-dev 2021-03-23 06:19:01 +00:00
Winson Chiu
5c3a853c0f Merge "Correct getDomainVerificationUserState docs" into sc-dev am: e446e84be3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13905235

Change-Id: I1368339565ff5f08cddc659060c4f80bb2168581
2021-03-22 19:18:37 +00:00
Pinyao Ting
b41bc495ec Shortcut integration with AppSearch (Part 5)
Following changes are implemented in this CL:
1. Persist shortcuts to icing whenever a shortcut is created/updated.
2. Delete shortcuts from icing only when publisher explicitly removes
the shortcut. i.e. deletion due to exceeding shortcut limit / disabling
shortcut do not lead to shortcut deletion from icing.
3. Call AppSearchSession#reportUsage when
ShortcutManger#pushDynamicShortcuts is invoked.
4. Add StrictMode warning for calling async method on mainthread.

Bug: 151359749
Test: atest ShortcutManagerTest1 ShortcutManagerTest2 ShortcutManagerTest3 ShortcutManagerTest4 ShortcutManagerTest5 ShortcutManagerTest6 ShortcutManagerTest7 ShortcutManagerTest8 ShortcutManagerTest9 ShortcutManagerTest10 ShortcutManagerTest11
Test: atest CtsShortcutManagerTestCases
Change-Id: I7ae7ec50a7e49f8de819d8239d429fc494017f96
2021-03-22 12:08:24 -07:00
Winson Chiu
e446e84be3 Merge "Correct getDomainVerificationUserState docs" into sc-dev 2021-03-22 16:58:33 +00:00
Charles Chen
d6b15f9e56 Merge "Enable to listen to WindowContext's config changes" into sc-dev am: b661dcbda6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13816185

Change-Id: I8038b906252900f8273a488d8a9ac219dd7529af
2021-03-22 13:50:19 +00:00
Jeff Sharkey
07754b568b Merge "Surface "neverForLocation" through public API." into sc-dev am: 7be2cf8c4b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13923564

Change-Id: I240180dc469c6b89c8c56458dcea1a0adba6d55b
2021-03-22 13:10:11 +00:00
Charles Chen
b661dcbda6 Merge "Enable to listen to WindowContext's config changes" into sc-dev 2021-03-22 12:28:02 +00:00
Jeff Sharkey
a57db58f24 Surface "neverForLocation" through public API.
Since developers can declare the "neverForLocation" flag in their
manifest as public API, we should also offer a way to inspect the
value that we parsed from the manifest.  We do this by surfacing it
through the existing PackageInfo.requestedPermissionsFlags field.

This also means we can remove the PackageManagerInternal API, since
interested parties can now check PackageInfo directly.

Fix a potential security issue by only accepting flags from manifest
when the application is targeting a modern enough SDK.

Bug: 181812281
Test: atest CtsContentTestCases:PackageManagerTest
Test: atest FrameworksServicesTests:PackageParserTest
Test: atest com.android.server.pm.parsing
Change-Id: I877768c06ee15281f3334794034f4af563e74569
2021-03-19 17:51:16 -06:00
Yuncheol Heo
7ff59f8556 Add Theme.setNewResourcesImpl() method.
- Race condition between Theme.setImpl() cnd Theme.applyStyle() can
  happen when creating Window and Configuration-change occur together.
- To maintain the integrity, the whole process of creating new ThemeImpl
  and setting it in Resources.setImpl() should be guarded by the lock.
- Moves the lock of ThemeImpl.mKey to Theme.mLock.

Bug: 173558667
Test: manual test in the bug
Change-Id: I9ebdc48333b188c0b26b1b7490a5cbb34bbe6e0f
2021-03-19 12:34:51 -07:00
Charles Chen
0783811428 Enable to listen to WindowContext's config changes
This CL overrides registerComponentCallbacks for
WindowContext. Users can use below code snippet
to listen to Configuration changes.
```
Context windowContext = context.createWindowContext(
        display, ...);
windowContext.registerComponentCallbacks(
        new ComponentCallbacks() {
            @Override
            public void onConfigurationChanged(
                    Configuration newConfig) {
                    // Do Something
                }
        });
```

Bug: 181134729
Test: atest WindowContextTests
Test: atest ComponentCallbacksControllerTest

Change-Id: Iff46607bae3c942a96b64dcc97708f3a8c33f23a
2021-03-19 21:56:35 +08:00
Remi NGUYEN VAN
7e26e33269 Merge "Add TEST_NETWORK_SERVICE to module API" 2021-03-19 02:32:00 +00:00
Winson
492e6558d1 Correct getDomainVerificationUserState docs
Clarifies that it's the Context's user being queried and updates for
the selection -> state rename.

Bug: 182345452

Test: none, docs change

Change-Id: Iaefc82b5e1c25292db1f694bf4f05d9f82b81958
2021-03-18 18:28:17 -07:00
Jeff Sharkey
e200247dad Merge "Add flags to <uses-permission> manifest tags." into sc-dev am: d8a9a21a84
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13844192

Change-Id: I13039f170b55e8daef44f6f67425b532b783f15e
2021-03-19 00:10:19 +00:00
Jeff Sharkey
d8a9a21a84 Merge "Add flags to <uses-permission> manifest tags." into sc-dev 2021-03-19 00:06:12 +00:00
Remi NGUYEN VAN
2bf4c58ceb Add TEST_NETWORK_SERVICE to module API
TestNetworkManager is being unbundled; the TEST_NETWORK_SERVICE constant
is necessary for the module to register the manager with
registerContextAwareService.

Bug: 171540887
Test: m
Change-Id: I0690251ddfcdaa8a34830e110b75869a370de389
Merged-In: I0690251ddfcdaa8a34830e110b75869a370de389
2021-03-19 00:04:24 +00:00
Tiger Huang
da96e37215 Merge "Let insets can still be controlled if its window bounds is moved" into sc-dev am: 1c7a274367
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13784130

Change-Id: I96bb6eb9a8d441f340e4d72fad92a7d0a8bdb3b4
2021-03-18 16:08:38 +00:00
Tiger Huang
1c7a274367 Merge "Let insets can still be controlled if its window bounds is moved" into sc-dev 2021-03-18 15:27:57 +00:00
TreeHugger Robot
163570845f Merge "Add TEST_NETWORK_SERVICE to module API" into sc-dev am: 043d71394c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13898748

Change-Id: Iefb3fda30470195d2ae9831e5ae6c60f089b3218
2021-03-18 10:36:14 +00:00
Kholoud Mohamed
82b6736ce3 Merge "Exposed some testAPIs in ActivityManager" into sc-dev am: 9c8071e410
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13677785

Change-Id: Id134b7c839bc9f7689a07d7284889c4ec1353b0a
2021-03-18 10:35:17 +00:00
TreeHugger Robot
043d71394c Merge "Add TEST_NETWORK_SERVICE to module API" into sc-dev 2021-03-18 10:33:54 +00:00
Remi NGUYEN VAN
d31b35212c Add TEST_NETWORK_SERVICE to module API
TestNetworkManager is being unbundled; the TEST_NETWORK_SERVICE constant
is necessary for the module to register the manager with
registerContextAwareService.

Bug: 171540887
Test: m
Change-Id: I0690251ddfcdaa8a34830e110b75869a370de389
2021-03-18 00:27:51 +00:00
Winson Chiu
3536b6a956 Merge changes I8d5a10c3,I3d629722,I35072d6e,I6cc270fb,I19b88fb5, ... into sc-dev am: a0ac8d3a31
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13856404

Change-Id: Id0be390e3770a8139022fa6570d64e2f6746a474
2021-03-17 21:36:32 +00:00
Thierry Strudel
3a5f680dbd Merge "rename power_stats service to powerstats" into sc-dev am: 491112e291
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13841207

Change-Id: I59c005da10d6efb45b99821304a2e6be7cf7d2a9
2021-03-17 21:29:19 +00:00
kholoud mohamed
23c36dbe21 Exposed some testAPIs in ActivityManager
- Added the following testAPIs to replace the usage
of adb shell commands in tests:
* stopUser and ACTION_USER_STOPPED
* waitForBroadcastIdle

- Changed the documentation for switchUser to correctly
reflect that it accepts CREATE_USERS

Test: verfied that tests can access the APIs
Bug: 181030374
Change-Id: I92b92471a18cf97a118d3f1946d6e06c277a76f1
2021-03-17 21:08:02 +00:00
Winson Chiu
a0ac8d3a31 Merge changes I8d5a10c3,I3d629722,I35072d6e,I6cc270fb,I19b88fb5, ... into sc-dev
* changes:
  Remove app links caller BROWSABLE requirement
  Fix DomainVerificationShell user/allowed bugs
  Remove pending/restored domain state when attaching
  Check user ID for domain verification setters
  Expose error codes for domain verification setters
  Move domain state ints to DomainVerificationInfo
  Migrate approved/denied domain states and add tests
2021-03-17 20:03:45 +00:00
Thierry Strudel
491112e291 Merge "rename power_stats service to powerstats" into sc-dev 2021-03-17 18:25:59 +00:00
Peter Collingbourne
7fe1ca63df Merge "Add support for a hw_timeout_multiplier system property." 2021-03-17 18:18:51 +00:00
Charles Chen
661351a645 Add OWNERS for ComponentCallbacksController
Bug: 181134729
Test: pre-upload check
Change-Id: I183c66c346b39ae6f731d197a0db31d00062ac7b
2021-03-17 22:27:20 +08:00
Jeff Sharkey
ea48e8e8b0 Add flags to <uses-permission> manifest tags.
As part of an upcoming feature, developers will need the ability to
clearly communicate that they'll never use a permission derive the
physical location of the device, regardless of ACCESS_FINE_LOCATION
and/or ACCESS_COARSE_LOCATION being granted.  The first use of this
is the BLUETOOTH permission, but developers may need to communicate
this for other permissions such as READ_PHONE_STATE, etc.

This change begins parsing this developer declaration as one of
multiple "usesPermissionFlags", which are then stored in a new
ParsedUsesPermission object.  To minimize refactoring, we continue
to offer this data through the older String-based APIs.

Bug: 181812281
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: I2ccda05cf416653d311151591f91ae55a729e05b
2021-03-16 14:29:59 -06:00
Winson
1122021b0c Remove app links caller BROWSABLE requirement
Does not require BROWSABLE category on the caller side anymore to apply
app links logic. However, it is now enforced on the receiver side, such
that all IntentFilter matches must contain BROWSABLE to be considered
approved for a domain.

Bug: 181890795

Change-Id: I8d5a10c3b8cc2370a4a69d4abe9ee74b1964f19e
2021-03-16 11:41:48 -07:00
Winson
173ef94284 Expose error codes for domain verification setters
Removes the InvalidDomainSetException and exposes the reasons as API
error codes. Implementers can check for a non-0 error code to tell if
the failure is meant to indicate a cancelled request.

Bug: 180991102

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

Change-Id: I19b88fb582fc7f633497d036a0590350ec463f3e
2021-03-16 11:41:44 -07:00