Commit Graph

9953 Commits

Author SHA1 Message Date
Jackal Guo
ccfa9a6682 Merge "Reduce package parsing times" 2020-12-03 05:57:53 +00:00
TreeHugger Robot
1d2102b503 Merge "Expose UwbManager through Context.getSystemService" 2020-12-02 21:58:01 +00:00
TreeHugger Robot
88a7d70b2b Merge "Annotate ContextWrapper with @Nullable" 2020-12-02 20:12:25 +00:00
Kevin Hufnagle
27b2c5cc6e Merge "docs: Mention app query filters on Android 11" into rvc-dev am: ace19f5537 am: c59c54bbe3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13113598

Change-Id: Ia15e30d2242d9cb67a658fa0145d71d64fd67153
2020-12-02 19:00:40 +00:00
Kevin Hufnagle
c59c54bbe3 Merge "docs: Mention app query filters on Android 11" into rvc-dev am: ace19f5537
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13113598

Change-Id: I851de99e1ef5686259b322e5b59d667b92997c17
2020-12-02 18:32:02 +00:00
Brian Stack
7d47f2c4d8 Expose UwbManager through Context.getSystemService
Bug: 170323306
Test: atest UwbManagerTests
Change-Id: I04c1263a191fcfeee5824be5d6d1944354819d02
2020-12-01 20:10:01 -08:00
Kevin Hufnagle
09478539ae docs: Mention app query filters on Android 11
For apps that target Android 11 and higher, the methods in this class
each return a filtered list by default, because of the new package
visibility behavior.

Test: m ds-docs-java

Bug: 173104139

Exempt-From-Owner-Approval: Docs-only change
Change-Id: Idd239a6a9b4e1764b8285f73a341adc024281be2
2020-12-01 19:02:29 -05:00
TreeHugger Robot
ab130fd905 Merge "Update CPA startActivity javadoc to refer to passing the result back" 2020-12-01 18:42:42 +00:00
Alex Kershaw
a28de433d8 Update CPA startActivity javadoc to refer to passing the result back
Update both versions of CrossProfileApps#startActivity to refer to
passing the result back to the passed in calling activity.

Bug: 174506563
Fixes: 171957840
Test: atest com.android.cts.devicepolicy.CrossProfileAppsHostSideTest#testStartActivityIntent_crossProfile_returnsResult
Change-Id: I14bf779d9307232b31300b828a1606c7411c7bb3
2020-12-01 16:22:52 +00:00
TreeHugger Robot
2200250bf8 Merge "Promote Context related tests to presubmit" 2020-12-01 07:59:24 +00:00
Zimuzo Ezeozue
d8c36b5888 Merge "Remove dead isolated storage code from StorageManagerService" 2020-11-30 20:55:29 +00:00
Jackal Guo
f2404ee37b Reduce package parsing times
After committing the install session, a single APK would be parsed
several times even if this APK doesn't change. We should store the
parsed result, and then reuse it to save unnecessary parsing calls
during the installation.

Bug: 138292426
Test: atest PackageManagerTest
Test: atest PackageManagerTests
Test: atest PackageManagerServiceTest
Test: atest PackageManagerShellCommandTest
Test: atest PackageParserTest
Test: manually both staged and non-staged install APK from adb
Test: manually install APK from Play Store and Android Studio
Change-Id: Ie786d964ac96536015e83e36865505a1f34e3cbf
2020-11-30 18:16:12 +08:00
Zim
7ac598f2ad Remove dead isolated storage code from StorageManagerService
Isolated storage was added in Q (and enabled by default) and has been
replaced by FUSE in R

Additionally, we can remove the ExternalStorageMountPolicy concept
which is only required if isolated storage is false

Cleanup in preparation to introduce DeviceConfig changes for
transcoding

Bug: 169327180
Test: Builds
Change-Id: Ie2686d8efa6654ea6c4b4ca8c121c0c1841a6356
2020-11-27 09:45:50 +00:00
TreeHugger Robot
bf598cdfbc Merge "SharedLibraryInfo.isNative() returns true for native libs" 2020-11-26 23:14:13 +00:00
Jiyong Park
4e4e82225a SharedLibraryInfo.isNative() returns true for native libs
This CL fixes a bug that SharedLibraryInfo.isNative() returns false
even for native shared libraries. This was because when a
SharedLibraryInfo is copied to a new SharedLibraryInfo (to add some
extra info about declaring package, etc.), the native-ness was
mistakenly ignored. Fixing the issue.

Also, the old constructor of SharedLibraryInfo that doesn't accept the
native-ness was removed to prevent similar mistakes.

Bug: 142191088
Test: atest CtsUsesNativeLibraryTest
Test: write an app that calls PackageManager.getSharedLibraries()
and inspect the mIsNative fields in the returned list. Entries for
native shared libs all have mIsNative=false. Will add a testcase to
the CTS test when isNative() becomes an API.

Change-Id: I35d9530f332614e0444448feec70a4461c9bbfa8
2020-11-24 18:35:37 +09:00
Hui Yu
20f42909f8 BG-FGS-launch restriction exemptions.
1. Add a new permission START_FOREGROUND_SERVICES_FROM_BACKGROUND.
2. Add a new bind flag BIND_ALLOW_FOREGROUND_SERVICE_STARTS_FROM_BACKGROUND
3. BroadcastOptions.setTemporaryAppWhitelistDuration() is currently
protected with CHANGE_DEVICE_IDLE_TEMP_WHITELIST permission, also open
it for START_ACTIVITIES_FROM_BACKGROUND and
START_FOREGROUND_SERVICES_FROM_BACKGROUND permission.
4. Exempt SYSTEM_ALERT_WINDOW permission.
5. if Context.startForegroundService() or Service.startForeground() is
restricted by BG-FGS-launch restriction, and app's targetSdkVersion is S
and above, throw a IllegalStateException.

Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagFGS
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagActivity
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsStartSystemAlertWindow
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsStartFromBGException

Change-Id: Iff3ed65e174a8406d4d6045cda42bdde6cecf30d
2020-11-23 11:19:59 -08:00
Bernardo Rufino
9aee235f28 Merge "Create recents protectionLevel" 2020-11-23 09:30:38 +00:00
Soonil Nagarkar
34bd00d5d2 Annotate ContextWrapper with @Nullable
Port Nullable annotations from Context to ContextWrapper.

Bug: 173863972
Test: n/a
Change-Id: I5decbba77149283bc68a2251d472618ca50219b8
2020-11-21 08:40:12 -08:00
Todd Kennedy
569435e0eb Implment get/query APIs for properties
Bug: 169258655
Test: atest CtsContentTestCases:PackageManagerGetPropertyTest
Test: atest CtsContentTestCases:PackageManagerQueryPropertyTest
Change-Id: I91d58cd42e7f1f10b0e494ff9f318a9e3fa073db
2020-11-21 08:12:13 -08:00
Todd Kennedy
c0b203cc38 Add package name and class name to Property
Instead of returning the package/property name from the
query methods, make it part of the Property object itself.

Bug: 169258655
Test: atest FrameworksServicesTests:PackageParserTest
Change-Id: I1c620cde317dc05fb49367a226a612bc01ae7f55
2020-11-20 21:31:13 -08:00
Todd Kennedy
b0036c0a93 Parse <property> tags
parse <property> tags defined on various components [application,
activity, activity alias, service, provider, and receiver]

Bug: 169258655
Test: atest FrameworksServicesTests:PackageParserTest
Change-Id: I4c94056db3909cc28636a9f93d875eff3d593f79
2020-11-20 21:31:13 -08:00
Todd Kennedy
e2d6cd588a Merge "Add PackageManager.Property class" 2020-11-20 16:35:37 +00:00
Charles Chen
480b5b733f Promote Context related tests to presubmit
Test: atest -p frameworks/base/core/java/android/app:presubmit
Test: atest -p frameworks/base/core/java/android/content:presubmit
Test: atest -p frameworks/base/core/java/android/view:presubmit
Bug: 170927371

Change-Id: I5c26418546cf4fcc710d5d0c2f6e5d10b2c03f84
2020-11-20 20:11:58 +08:00
Alex Buynytskyy
27eb04a5a3 API feedback.
Bug: 160605420
Test: atest ChecksumsTest
Change-Id: If6796d6779228c1972750822aea5057df5148b70
2020-11-19 17:00:41 +00:00
Bernardo Rufino
0dec6c042c Create recents protectionLevel
In preparation for permission BROADCAST_CLOSE_SYSTEM_DIALOGS
(go/close-system-dialogs), which will be signature|recents in order to
lock down Intent.ACTION_CLOSE_SYSTEM_DIALOGS. That intent is used by
recents when it's invoked.

Currently, recents is configured via existing config
config_recentsComponentName, so using that to determine the recents
package in PM.

It's my understanding that the package defined in such config will be
responsible for recents no matter which launcher is active. It's also my
understanding that the package being explicit in the system config means
that package has to come from the system image, hence it's fine to use
ensureSystemPackageName() in PM. Please advise if any of
this is wrong.

Test: Will work on CTS once we agree on the proposal here.
Bug: 159105552
Change-Id: I9f73e1f05d8df26666da156b672e370dce5030de
2020-11-19 14:39:51 +00:00
Charles Chen
7d77103f1e Release detectIncorrectContextUse
also link it in Context#isUiContext(Context).

Test: build & run
Bug: 170275820
Change-Id: Ide1195af1d11bb33a846420b92de70325c0ecf61
2020-11-19 13:45:33 +08:00
Charles Chen
351a4ce3ea Merge "Release Context#isUiContext(Context)" 2020-11-19 05:35:46 +00:00
Mehdi Alizadeh
8c68af5d00 Merge "Adds a new flag in ShortcutQuery to return person data" 2020-11-18 20:52:06 +00:00
Todd Kennedy
c26e1f9111 Add PackageManager.Property class
Initial implementation of the Property class. It's not
used yet, but will be.

Define new <property> tag in manifest

Bug: 169258655
Test: atest FrameworksCoreTests:PackageManagerPropertyTests
Change-Id: I1809a82e5af4bfdd26e375d9038b632947ad91c0
2020-11-18 09:28:26 -08:00
Treehugger Robot
be18b92c83 Merge "Migrate THROW_SECURITY_EXCEPTIONS" am: 3724bc6c47 am: e0b1e5c604 am: 39a0624f7f am: 4ca688adf8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492845

Change-Id: I09486c074ffdf42c003dff959a865a6379e6d334
2020-11-18 10:47:54 +00:00
Treehugger Robot
4ca688adf8 Merge "Migrate THROW_SECURITY_EXCEPTIONS" am: 3724bc6c47 am: e0b1e5c604 am: 39a0624f7f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492845

Change-Id: I2b4e2a38a596bfeb76e9a5af247b4bbb509db9ab
2020-11-18 09:57:57 +00:00
Treehugger Robot
3724bc6c47 Merge "Migrate THROW_SECURITY_EXCEPTIONS" 2020-11-18 09:19:11 +00:00
Charles Chen
853c0f31b5 Release Context#isUiContext(Context)
The purpose of this API is to verify whether a context is an
UI context or not. We can also leverage the jetpack WindowManager
to all kinds of UI contexts v.s. Activities only currently by
release this API.

Bug: 170275820
Test: atest ContextIsUiContextTest
Change-Id: I334b63e555331e46d0a94ec9f721bd675f1ab331
2020-11-18 14:35:48 +08:00
Alex Buynytskyy
0feb7574c2 Merge "Detect duplicate addChecksums calls." 2020-11-18 02:24:51 +00:00
Alex Buynytskyy
373a01c3ad Detect duplicate addChecksums calls.
Bug: 160605420
Test: atest ChecksumsTest
Change-Id: I1a56865b0b27845494a337bd1d8fb49ca346af2f
2020-11-17 23:44:20 +00:00
Mehdi Alizadeh
62875c9608 Adds a new flag in ShortcutQuery to return person data
Bug: 169878448
Test: atest com.android.server.pm.ShortcutManagerTest1
            com.android.server.pm.ShortcutManagerTest2
            com.android.server.pm.ShortcutManagerTest3
            com.android.server.pm.ShortcutManagerTest4
            com.android.server.pm.ShortcutManagerTest5
            com.android.server.pm.ShortcutManagerTest6
            com.android.server.pm.ShortcutManagerTest7
            com.android.server.pm.ShortcutManagerTest8
            com.android.server.pm.ShortcutManagerTest9
            com.android.server.pm.ShortcutManagerTest10
            com.android.server.pm.ShortcutManagerTest11
Change-Id: Iafbd558e542c40a808bfd9b13dc7d69c92e76cfc
2020-11-17 15:21:20 -08:00
Jeff Sharkey
5058d5e99f Hand-migration to TypedXml interface.
Previous changes have applied mechanical refactorings, but this change
hand-migrates the remaining logic which was too complex to identify.

This change should have no behavior change; famous last words.

Bug: 171832118
Test: manual
Change-Id: I73f63cdb84d27e87c2af5a36d043cc225f1c749c
2020-11-17 11:09:02 -07:00
Sally Yuen
67bf1480cf Merge "Change forceBoldText to fontWeightAdjustment in Configuration" 2020-11-16 16:55:48 +00:00
Charles Chen
e9cf1f9847 Merge "Introduce getWindowContextToken" 2020-11-16 08:47:01 +00:00
Charles Chen
468a11afdd Introduce getWindowContextToken
Also consolidate UI context related flags to ContextType.

Bug: 171280916
Test: atest ContextTest ContextAccessTest
Test: atest WindowContextTest WindowContextTests \
            WindowMetricsTest WindowMetricsTests
Test atest InputMethodServiceStrictModeTest \
           InputMethodMenuControllerTest
Test atest InputMethodServiceTest#testGetDisplay
           StrictModeTest#testIncorrectContextuse_*

Change-Id: I7f3a7f951c664d4c329059942e688ee3a625b992
2020-11-16 14:19:36 +08:00
Sean Stout
bf9b900f18 Merge "Add hidden API to retrieve ActivityInfo" 2020-11-13 21:48:52 +00:00
Songchun Fan
e2086954e9 [pm/incremental] add @FloatRange in the new LauncherActivityInfo API
Addressing the comment in b/171804873

BUG: 171804873
Test: builds
Change-Id: Ie7980973572443007f9205535ab9da575d3ea97b
2020-11-13 21:25:38 +00:00
Sally
b2ebd0d535 Change forceBoldText to fontWeightAdjustment in Configuration
Convey the weight adjustment instead of a binary on/off

Bug: b/170966021, b/110991537
Test: atest CtsContentTestCases
Change-Id: I4f8de658cb49c2e3d81ce6b25338d6e7c9a5e789
2020-11-13 19:45:18 +00:00
Aurimas Liutikas
ab35d18a7c Merge "Suppress all hidden abstract methods in constructable classes." am: bdd6c53abb am: c08c4d9b02 am: 65ed2cb534
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1495396

Change-Id: Icb989e4ac7190afbdb3b09552fa0055c2a742ceb
2020-11-13 03:49:22 +00:00
Aurimas Liutikas
bdd6c53abb Merge "Suppress all hidden abstract methods in constructable classes." 2020-11-13 02:56:37 +00:00
Aurimas Liutikas
d23189b998 Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Merged-In: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-13 02:56:20 +00:00
Aurimas Liutikas
8f8eaec801 Merge "Suppress all hidden abstract methods in constructable classes." 2020-11-12 23:37:21 +00:00
Jackal Guo
9b93658322 Merge "metaData should be null without GET_META_DATA flag" 2020-11-12 23:23:12 +00:00
Aaron Labiaga
0596e00fab Merge "Fix typo. This has been bothering me a lot :)" 2020-11-12 17:40:25 +00:00
Andrei-Valentin Onea
6a8af4fd1d Merge "Migrate FILTER_APPLICATION_QUERY" am: 714960f745 am: 9aa009684b am: fe2b1a414c am: 056959a186
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492847

Change-Id: Ib81bef18d09760f9c3674e520fa7a2f9f9928da3
2020-11-12 15:18:16 +00:00