Commit Graph

9868 Commits

Author SHA1 Message Date
TreeHugger Robot
b41548eb6b Merge "Do not allow uninstalling while an app is pinned" 2020-10-30 16:55:50 +00: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
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
TreeHugger Robot
05e768ced6 Merge "Do not allow to install S+ apps with cross cert permissions" 2020-10-22 00:14:32 +00:00
Songchun Fan
56838fba12 Revert "Revert "[incremental/pm] LauncherApps APIs for loading state and progress""
This reverts commit 69475be847.
Also reverts commit Iaf8e2c075f188df95c68824b71362629c6adabfc.

Reason for revert: Trying again but will submit with new tests

BUG: 165841645
Test: atest NexusLauncherOutOfProcTests
Test: atest LauncherAppsSingleUserTest
Test: atest LauncherAppsMultiUserTest
Test: atest LauncherAppsProfileTest
Test: atest LimitAppIconHidingTest
Change-Id: I5ed5871ccddefbd922b3aa3ee4c1ad53cc0bfa9b
2020-10-21 14:20:20 -07:00
Philip P. Moltmann
22d2486c1f Do not allow to install S+ apps with cross cert permissions
I.e. permissions and permission groups should stay inside a cert-group
so that there cannot be accidential security bugs in apps.

Test: atest CtsPermissionTestCases
            CtsPermission2TestCases
	    CtsAppSecurityHostTestCases
Fixes: 146211400 (No backport possible, all changes are for S+ apps
only)
Change-Id: I19c2f3e216ea57a9e25c65e276f87425aeb1c038
2020-10-21 18:58:16 +00:00
Jeff Sharkey
1992cdb4de Merge changes from topic "oct16c"
* changes:
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStringsChecker.
  Apply fixes for EfficientCollections.
  Trivial refactor for consistent naming.
  Expand formatSimple() to support widths.
  Refinement of EfficientStringsChecker.
2020-10-21 15:27:15 +00:00
Tiger Huang
9e2c966d61 Merge "Don't dispatch legacy insets to client" 2020-10-21 15:23:27 +00:00
Tiger Huang
2bf8c796c5 Don't dispatch legacy insets to client
The server won't dispatch the legacy content insets, stable insets, and
visible insets to the client. The insets would be computed from the
insets state by the client.

This CL also fixes the insets scaling issue in compatible mode.

Bug: 149813814
Fix: 169940916
Fix: 165412978
Test: atest WindowAddRemovePerfTest InsetsAnimationControlImplTest
            ActivityRecordTests DisplayPolicyLayoutTests
            InsetsPolicyTest InsetsStateControllerTest
Change-Id: I83570973f587a6abf887752494f750b46e3e484d
2020-10-21 20:20:21 +08:00
Jeff Sharkey
c603ca2dd8 Apply fixes for EfficientStrings.
Refactoring to avoid StringBuffer synchronization overhead.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ibf843ed780c1202d5d96a11eaca889e592f19263
2020-10-20 22:00:20 -06:00
Jeff Sharkey
f18719bb73 Apply fixes for EfficientStrings.
Refactoring to avoid paying the cost of extra StringBuilder that are
quickly disposed.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Icd914a63cdadf8123c1e5a5073f85245f0791f0b
2020-10-20 22:00:18 -06:00
Jeff Sharkey
1c08f48253 Apply fixes for EfficientStringsChecker.
The recently-built Error Prone checker has found many instances where
we're always paying the cost of StringBuilder concatenation, even in
the typical cases where preconditions are successfully met.

Benchmarks have shown that even when replacing these with varargs
formatter strings, the default case is 20x faster.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If8c00bc73467bfb91ec16c162969c9d26ca53646
2020-10-20 22:00:16 -06:00
Jeff Sharkey
df8dc2b4a5 Apply fixes for EfficientCollections.
Drop-in replacements suggested for inefficient collections.  Also
annotate a handful of places where we're unable to update.

Bug: 155703208
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I48b600508df8160ac9b40fea7afca974b2c972f6
2020-10-20 21:57:00 -06:00
Rhed Jao
940cd5ae33 Deprecates GET_INTENT_FILTERS in the PackageManager
This constant has never been used. The platform does not support
getting intent filters for the package.

Bug: 73780749
Test: Build
Change-Id: I907077b2a07e4a88aa8994ed3c25991b6d1172b4
2020-10-21 11:52:42 +08:00
Anton Hansson
24b4d166dd Merge "Remove @TestApi from @SystemApi symbols" am: d2d4637685 am: cbe282347e am: 14897c256d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466264

Change-Id: I859503688ea3254d5bd1b55e80cf1962286e948f
2020-10-20 20:31:58 +00:00
Hall Liu
02a0aad4fd Expose PackageManager methods around system apps
Expose PackageManager#setSystemAppState and associated constants for use
by a future Telephony mainline module. Add restrictions on modifying
core apps if the caller is not from the system or phone uids.

Fixes: 168621241
Test: atest PackageManagerTest#testSetSystemAppHiddenUntilInstalled
Change-Id: I9a219b4b24abdb90dccca81038279bdae4285e7f
2020-10-20 13:05:07 -07:00
Anton Hansson
d2d4637685 Merge "Remove @TestApi from @SystemApi symbols" 2020-10-20 13:45:13 +00:00
Anton Hansson
586a3cf229 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
Songchun Fan
5c2ad1c98c Merge "Revert "Revert "[pm/incremental/api] exposing package state names and reasons""" 2020-10-20 01:12:08 +00:00
Songchun Fan
4377d446ce Revert "Revert "[pm/incremental/api] exposing package state names and reasons""
This reverts commit cf4c99720b.

Reason for revert: not related to launcher changes

Test: will add CTS tests.
BUG: 162600626
CTS-Coverage-Bug: 168925819
Change-Id: I5a6832ef7907c2be90758a553514fb0dedb8c8e1
2020-10-19 22:58:28 +00:00
Anton Hansson
dd7d52f963 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Makoto Onuki
b1cfbc85b5 Expose BAL related APIs as @SystemApi
... Because the permission is already privileged and used by unbundled APKs.

Bug: 171062986
CTS-Coverage-Bug: 171196794
Test: build
Change-Id: Ibd6f961094fab8af71cfa26f54d97e69496633e2
2020-10-19 15:11:52 +00:00
Greg Kaiser
db1a1524b5 Merge changes I2f7b198f,I229b39ce,Iaf8e2c07
* changes:
  Revert "[incremental/pm] LauncherApps APIs for loading state and progress"
  Revert "[pm/incremental/api] exposing package state names and reasons"
  Revert "Fix LauncherAppsService queryIntentLauncherActivities"
2020-10-16 16:57:02 +00:00
TreeHugger Robot
2ef3f14284 Merge "Add WindowLayoutAffinity attribute." 2020-10-16 16:54:56 +00:00
Greg Kaiser
69475be847 Revert "[incremental/pm] LauncherApps APIs for loading state and progress"
This reverts commit 0173a44f3d.

Bug: 170959052
Test: Locally confirmed two reverts together fix app tray
Change-Id: I2f7b198f77b54be671c7f02bc2b67838bf99d28b
2020-10-16 07:34:43 -07:00