Commit Graph

9927 Commits

Author SHA1 Message Date
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
Alex Buynytskyy
27eb04a5a3 API feedback.
Bug: 160605420
Test: atest ChecksumsTest
Change-Id: If6796d6779228c1972750822aea5057df5148b70
2020-11-19 17:00:41 +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
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
Aaron Labiaga
48fca5cfcb Fix typo. This has been bothering me a lot :)
Change-Id: I55b373e5f5573a5bf791bf078d12fde7f08a1121
2020-11-12 15:13:11 +00:00
Andrei-Valentin Onea
056959a186 Merge "Migrate FILTER_APPLICATION_QUERY" am: 714960f745 am: 9aa009684b am: fe2b1a414c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492847

Change-Id: I1d179c79948d987f4b0d51f642ddf81b99f28e2b
2020-11-12 15:05:02 +00:00
Andrei-Valentin Onea
714960f745 Merge "Migrate FILTER_APPLICATION_QUERY" 2020-11-12 13:09:53 +00:00
Sean Stout
b93a88095b Add hidden API to retrieve ActivityInfo
This API will be used by Exo to determine whether the Activity supports
only portrait or landscape.

Bug: 172927807
Test: make
Change-Id: I290b051b645e2bfb9eff9b615b44a08fe439ceca
2020-11-11 16:17:23 -08:00
Aurimas Liutikas
796760c56e 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
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-11 23:16:32 +00:00
TreeHugger Robot
29208e8f64 Merge "Do not allow uninstalling while an app is pinned" into rvc-qpr-dev am: bca739053d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12940775

Change-Id: I0f93b91e6456c0aa72d81e0ac2e0d9df86860dd5
2020-11-11 21:42:19 +00:00
Paul Hu
c1a6f7a0b1 Merge "Expose some ApplicationInfo#is* methods as in-process API" am: 5753a34e67 am: d573e85816 am: 2c2b8ff2c3 am: 483c7f78d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490916

Change-Id: If447de2175a0629d34cb218d9a891f5ba4bfa365
2020-11-11 06:44:47 +00:00
Paul Hu
483c7f78d5 Merge "Expose some ApplicationInfo#is* methods as in-process API" am: 5753a34e67 am: d573e85816 am: 2c2b8ff2c3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490916

Change-Id: I54813df3a029add049ee622dcdcb2caeb32c1747
2020-11-11 06:14:55 +00:00
Jackal Guo
0313a00eb5 metaData should be null without GET_META_DATA flag
Additional meta-data associated with the component should only be
filled in if caller sets the GET_META_DATA flag when requesting
the info.

Bug: 171545647
Test: atest PackageManagerTest
Change-Id: I3c4f000043a7db667192ca4379390df5548f8ab0
2020-11-11 13:40:46 +08:00
Paul Hu
5753a34e67 Merge "Expose some ApplicationInfo#is* methods as in-process API" 2020-11-11 05:23:56 +00:00
Rhed Jao
72ee0c217f Merge "Limit length of package name and shared user id" 2020-11-10 02:10:34 +00:00
Andrei Onea
51f631383a Migrate FILTER_APPLICATION_QUERY
Use @EnabledSince instead of @EnabledAfter for FILTER_APPLICATION_QUERY.

Test: m
Bug: 172238506
Change-Id: Iedb82b9ec3ff503e6c7fa912470c21aa31032688
2020-11-09 21:34:19 +00:00
Andrei Onea
1af46efa1c Migrate THROW_SECURITY_EXCEPTIONS
Use @EnabledSince instead of @EnabledAfter for
THROW_SECURITY_EXCEPTIONS.

Test: m
Bug: 172238506
Change-Id: Idfc08b82493dfece24e838b74e2a4690459a146e
2020-11-09 21:23:20 +00:00
paulhu
cc8b163dba Expose some ApplicationInfo#is* methods as in-process API
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. But PermissionMonitor needs
ApplicationInfo#is(Vendor|Oem|Product) APIs to know the package
partition. Thus, expose them as in-process API to support the
usage.

Bug: 170593746
Test: atest FrameworksNetTests
Change-Id: Ie4ffb2b47539786dd51b885ca93c8813d039c4da
2020-11-09 06:17:28 +00:00
Songchun Fan
8a1376cb42 [pm/incremental] remove LauncherActivityInfo.isStartable()
This API is not needed because any installed app is startable. See
go/incremental-when-to-freeze for detailed discussion.

BUG: 171299283
BUG: 171920377
Test: atest LauncherAppsSingleUserTest
Change-Id: I665b1005780babd02677a0f4ad8284ac81a5502e
2020-11-06 23:56:22 +00:00
Rhed Jao
6dc63526e5 Limit length of package name and shared user id
Package name and shared user id could be used as part of filename
as prefix by other modules. Limits the length to 223 and reserves
32 for the OS.

Bug: 118768971
Test: atest PackageManagerTest
Change-Id: I524a20ac3ed336b1a580f9be324dce460e7f8388
2020-11-06 15:50:02 +08:00
Eugene Susla
3f1e82b12c Merge "Disregard annotation params for stale dataclass detection" 2020-11-04 23:57:15 +00:00
Eugene Susla
ddb2681455 Disregard annotation params for stale dataclass detection
Annotation processor seens annotation args with constants already inlined,
making it challenging to compare to the souce-generated metadata that contains
initial expressions.

For now just ignoring args for all non-DataClass annotations to prevent false positives

Test: . frameworks/base/tests/Codegen/runTest.sh
Exempt-From-Owner-Approval: changing metadata on multiple files
Change-Id: I640816ae0f20f36b1b828bc2161f53788c4a4dae
2020-11-04 12:40:58 -08:00
Songchun Fan
2ea086d3f3 [pm/incremental] disable unstartable state and hide related APIs
Per discussions in go/incremental-when-to-freeze, we will not mark an
app unstartable, regarless of streaming health metrics.

This CL is a temporary disablement. The startable state will remain true,
and there will be no broadcasts about startability.

The event tracking and health monitoring is kept as is.

If we get feedback and need to put it back, it'll be a small change.
Otherwise, we will clean up the related code.

+ also fix storage health monitoring params

BUG: 171920377
Test: builds
Change-Id: Idf7d32d0ca3a6e08c9673914f27f22b531b91ac2
2020-11-04 15:36:27 +00:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Winson Chung
f97bf81d1e Merge changes I581de3ff,I7d777c59
* changes:
  5/ Validate and resolve shortcut & task activity infos
  4/ Add basic drag and drop policy & handler for the shell
2020-11-04 05:57:22 +00:00
Winson Chung
3317d134cc 5/ Validate and resolve shortcut & task activity infos
- Resolve shortcut activity infos
- Fix issue with resolving activity infos for restored tasks after reboot

Bug: 169894807
Test: atest DragDropControllerTests
Change-Id: I581de3ff31747e4a3369ef5b8c96cef132aa2bb5
2020-11-03 15:52:37 -08:00
TreeHugger Robot
5434c0b2dc Merge "Fix the orphan child session after abandoning the parent session" 2020-11-03 12:51:53 +00:00
JW Wang
96ee7c1cc3 Merge "Remove dead code" 2020-11-03 05:45:49 +00:00