Commit Graph

9891 Commits

Author SHA1 Message Date
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
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
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
Treehugger Robot
c424759edd Merge "Deprecate PackageParser main class and add OWNERS" am: d40928888b am: abec6cf449 am: 43f102ed62 am: bde98cf8d0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456036

Change-Id: I39e02f7783ca502f7a01539a6b16bcda044a2504
2020-11-03 02:15:27 +00:00
Treehugger Robot
bde98cf8d0 Merge "Deprecate PackageParser main class and add OWNERS" am: d40928888b am: abec6cf449 am: 43f102ed62
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456036

Change-Id: I3812d550d8792d4e412c5b0e6fab56c69d4cb6d0
2020-11-03 01:58:36 +00:00
Treehugger Robot
d40928888b Merge "Deprecate PackageParser main class and add OWNERS" 2020-11-03 01:10:15 +00:00
Mathew Inwood
5f0edaaaf5 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: I8285daa8530260251ecad6f3f38f98e263629ca7
Change-Id: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
2020-11-02 10:30:09 +00:00
Songchun Fan
652c0bb190 [pm/incremental] address API review comments for LauncherApps APIs
+ change "*Progress*" to "*LoadingProgress*".
+ removed "LauncherActivityInfo.isLoading()" because it can be derived
from "LauncherActivityInfo.getLoadingProgress()".

BUG: 171804873
Test: atest LauncherAppsSingleUserTest
Change-Id: I001e8d946a13bcf43c03081e730ac07a1c3cf4bc
2020-10-30 21:15:59 +00:00
TreeHugger Robot
b41548eb6b Merge "Do not allow uninstalling while an app is pinned" 2020-10-30 16:55:50 +00:00
Felka Chang
18d20709e0 Fix the orphan child session after abandoning the parent session
In the multipackage staged session set condition, whenever a committed
parent session called abandon(), only calling dispatchSessionFinished()
on the parent session would leave its children session as the orphan
child sessions. The child sessions aren't handled very well and they
would be never handled if the installer applications forget to handle
them.

The solution is to notify the each child session in this multipackage
session after the parent session is abandoned. And, to add the
com.android.tests.atomicinstall.SessionAbandonBehaviorTest to verify the
behavior.

Test: atest StagedInstallInternalTest
Test: atest -p \
    frameworks/base/services/core/java/com/android/server/pm/TEST_MAPPING
Test: atest CtsAtomicInstallTestCases
Test: # monitor the log after atest stagedInstallInternalTest and reboot.
Bug: 164964410
Change-Id: I23dabf7da099baebed63e9f9fc73383984015070
2020-10-30 18:10:20 +08:00
Benedict Wong
76062fa471 Merge "Add shell VcnManagementService" am: fa2c588ab5 am: 1ee8f22e8a am: e0eb89cf66 am: 3eda5ec4f9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456942

Change-Id: Ib6d081351c2440945d094e7e97433f1e91e1fa8b
2020-10-29 23:20:36 +00:00
Benedict Wong
3eda5ec4f9 Merge "Add shell VcnManagementService" am: fa2c588ab5 am: 1ee8f22e8a am: e0eb89cf66
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456942

Change-Id: I774426130072afa26da857ee66b724f94b627cd7
2020-10-29 23:07:47 +00:00
Aaron Labiaga
2e84102227 Merge "update setCategories javadoc to include info of its usage in sharing shortcuts" 2020-10-29 19:42:16 +00:00
Dmitri Plotnikov
ec2bc8d99f Add async version of "uncanonicalize"
This CL is basically identical to http://ag/10353234, which
did the same with the sister method, "canonicalize".

Fixes: b/147705670
Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Change-Id: Ide93850f225cdd61779a62fc2c4666efe438b536
2020-10-28 17:27:27 -07:00
Nikita Dubrovsky
9d22de952d Merge "Update ClipData.toString and related code to not leak common forms of PII" 2020-10-28 20:28:50 +00:00
Hall Liu
3f78b81b23 Merge "Expose PackageManager methods around system apps" 2020-10-28 20:03:11 +00:00
Aaron Labiaga
2360b185a7 update setCategories javadoc to include info of its usage in sharing shortcuts
Change-Id: Ia300b3954541e5c17519ea8cdc798b6148c27925
2020-10-28 19:25:59 +00:00
Mehdi Alizadeh
424427a8d1 Merge "Add additional doc to setCategories to include info of field in share targets" 2020-10-28 19:13:12 +00:00
Mathew Inwood
ee5d369323 Merge "Add maxTargetSdk restriction to unused APIs." 2020-10-28 09:39:20 +00:00
Benedict Wong
e2dacc7411 Add shell VcnManagementService
This patch adds a shell of the VcnManagementService and VcnManager

Bug: 163431877
Test: Compiles, Boots
Change-Id: I1f3d8ab9c9bff7d419ea6d3edaae3b6b41b1d775
2020-10-27 20:09:06 -07:00
Nikita Dubrovsky
e95a36411e Update ClipData.toString and related code to not leak common forms of PII
Bug: 171732792
Test: atest CtsContentTestCases:ClipDataTest
Change-Id: I530795fb8bf6d69e33c1122b1cf8b9e9e4c6aee4
2020-10-27 16:31:19 -07:00
TreeHugger Robot
1086c93f77 Merge "Removing taking unrelated locks from holdLock" 2020-10-27 17:46:12 +00:00
Nikita Dubrovsky
e160845809 Merge "Add View.onReceiveContent() and View.getOnReceiveContentMimeTypes()" 2020-10-27 16:51:24 +00:00
Mathew Inwood
72f07d6a8a 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
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Aaron Labiaga
f77a5f4467 Add additional doc to setCategories to include info of field in share targets
Change-Id: Ifd899760c22490cb8d504d4cc84c7f89551dceac
2020-10-27 15:39:37 +00:00
JW Wang
5731f9a938 Remove dead code
Remove dead code since we no longer create extra apk sessions
per b/163037460.

Bug: 171036571
Test: atest StagedRollbackTest
Change-Id: I978e93decc6789fd6f25c2b6d3706dd1fa7d0995
2020-10-27 12:06:44 +08:00
vadimt
22676d6118 Removing taking unrelated locks from holdLock
Test: running tests with the lock contention stress mode
Bug: 168630376
Change-Id: I5665eb7100d2fcbb93c7ade6cc30b0d8519246bb
2020-10-26 18:44:08 -07:00
Winson Chung
8c1fc3ea3a 2/ Add support for dragging shortcuts and tasks
- Add mechanism for creating PendingIntents to launch apps in the same
  way as starting through LauncherApps service
- Require callers starting a task launch to either be the recents
  component or have the START_TASKS_FROM_RECENTS permission

Bug: 169894807
Test: atest LauncherAppsTest
Test: atest DragDropControllerTest
Change-Id: I2f9f622b4ef7a8aba06b0854a1549a2c07cf38e1
2020-10-26 14:33:05 -07:00
Evan Severson
585e5c46d5 Do not allow uninstalling while an app is pinned
If an app is pinned we want to avoid ways to unpin without entering a
set passcode. If the package of the base activity in the pinned activity
stack is uninstalled then the device exits pinning mode so we want to
restrict uninstalling this package.

Bug: 135604684
Test: Pin test app, test app tries to uninstall itself
      Pin test app, `adb uninstall`
      Pin test app, test app launches second test app, assert that
          second test app can be uninstalled but base test app can't

Change-Id: I32ee438e9dd9e245bed6e6a9f4efd0abbb70de1f
2020-10-26 13:30:09 -07:00
Nikita Dubrovsky
82a414a184 Add View.onReceiveContent() and View.getOnReceiveContentMimeTypes()
Added View.onReceiveContent() which will invoke the callback if one
is set.

Added View.getOnReceiveContentMimeTypes() to return the MIME types
that the view can receive, removing the getSupportedMimeTypes()
method from the callback interface.

Changed the code to pass MIME types as a String[] instead of a
Set<String> in order to:
* Avoid repeated conversion from Set to array in
onCreateInputConnection.
* Avoid misleading users of the API into using contains() to compare
MIME types (ClipDescription.compareMimeTypes should be used in order to
correctly handle wilcards such as "image/*").

Bug: 170191676
Bug: 152068298
Test: atest CtsViewTestCases:ViewTest
Test: atest CtsViewTestCases:ViewOnReceiveContentTest
Test: atest CtsWidgetTestCases:TextViewOnReceiveContentCallbackTest
Test: atest FrameworksCoreTests:TextViewOnReceiveContentCallbackTest
Test: atest FrameworksCoreTests:AutofillValueTest
Change-Id: Id0c7f8f5fd3c7c44827a62dba1b2b205433e7540
2020-10-26 12:12:01 -07:00
Winson Chung
fb314e008e Merge "1/ Add basic infra for global drag handling in the Shell" 2020-10-23 23:59:19 +00:00
Winson Chung
c932060175 1/ Add basic infra for global drag handling in the Shell
- Add private window flag INTERCEPT_GLOBAL_DRAG_AND_DROP (protected by
  MANAGE_ACTIVITY_STACKS permission) to be considered as a part of the
  normal flow for global drag and drops even if the window is not
  visible.  In addition, the window with the flag receives the clip
  data on DRAG_STARTED and the drag surface on DROP.  If the window
  consumes the drop, then it will relinquish cleanup of the drag surface
  from the system.
- Add MIMETYPE_APPLICATION_ACTIVITY for an app to report that they are
  starting a global drag of an activity. The associated data must
  include an intent with the pending intent and user to launch the
  activity for.
- Add a test drag handler on the shell end to receive the drag, setup a
  drag layout, and just launch the intent (for now).

Bug: 169894807
Test: atest DragDropControllerTest
Test: atest DragDropTest

Change-Id: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Merged-In: I7f5cdca3cf515b693a8f1e507e90e22a670b5fa6
Signed-off-by: Winson Chung <winsonc@google.com>
2020-10-23 20:00:19 +00:00
Songchun Fan
8c7bfcd5ab Merge "Revert "Revert "[incremental/pm] LauncherApps APIs for loading state and progress""" 2020-10-23 17:44:53 +00:00
TreeHugger Robot
bcf16c151e Merge "Remove PackageManager.getResourcesForApplicationAsUser API" 2020-10-23 05:52:01 +00:00
Felka Chang
91581bf1bb Merge "Remove PackageManager.getResourcesForApplicationAsUser API" 2020-10-22 13:01:35 +00:00
Rhed Jao
81cecc5035 Merge "Renames EXTRA_REMOVED_BY_SYSTEM to EXTRA_USER_INITIATED" 2020-10-22 04:26:37 +00:00
Rhed Jao
5224aafbf6 Merge "Deprecates GET_INTENT_FILTERS in the PackageManager" 2020-10-22 02:12:09 +00:00
Felka Chang
3e1776c67c Remove PackageManager.getResourcesForApplicationAsUser API
To switch another user to do something should create the context of the
specified user by using Context.createContextAsUser rather than call
*AsUser API directly.

Replacing PackageManager.getResourcesForApplicationAsUser with
context.createContextAsUser(...) applys in not only ShortcutService
but also the related ShortcutManager test.

Test: TEST_NAME="FrameworksServicesTests"; \
    PACKAGE_NAME="com.android.server.pm.ShortcutManagerTest"; \
    MODULE_LIST="CtsShortcutHostTestCases CtsShortcutManagerTestCases"; \
    for i in `seq 1 11`; \
    do\
      MODULE_LIST="${MODULE_LIST} ${TEST_NAME}:${PACKAGE_NAME}${i}"; \
    done; \
    atest $MODULE_LIST
Test: make -j droid cts gts vts
Test: make -j docs
Test: atest SystemUITests \
    FrameworksServicesTests:com.android.server.pm
Bug: 170928809
Change-Id: I5a4acce42b0d71e405412f84aaa73c0dfbb610e4
2020-10-22 08:28:47 +08:00