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
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
* 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.
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
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
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
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
This constant has never been used. The platform does not support
getting intent filters for the package.
Bug: 73780749
Test: Build
Change-Id: I907077b2a07e4a88aa8994ed3c25991b6d1172b4
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
... Because the permission is already privileged and used by unbundled APKs.
Bug: 171062986
CTS-Coverage-Bug: 171196794
Test: build
Change-Id: Ibd6f961094fab8af71cfa26f54d97e69496633e2
* 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"
This reverts commit e0b6a4df83.
Reason for revert: Testing a fix for b/171027242 - this doesn't imply this revert will be needed, or the commit is at fault.
Change-Id: Iaf8e2c075f188df95c68824b71362629c6adabfc
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.
Test: make -j droid cts gts vts
Test: make -j docs
Test: atest SystemUITests \
FrameworksServicesTests:com.android.server.pm
Fix: 170928809
Bug: 72863210
Change-Id: Ie1999ba9cf61a4e85b7172240cb198111389ab73
ag/12640480 accidentally changed the logic of
`queryIntentLauncherActivities`. Fixing it and
adding a few polish.
Test: atest NexusLauncherOutOfProcTests
BUG: 170963871
BUG: 170959052
Change-Id: I9a69ac15aba4d67fc03a581c381ead3cc3eae073
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.
The change was generated by running
find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'
in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.
Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
- Made all fields private.
- Replaced ParsedPermission usage with PermissionInfo.
The BasePermission class was using ParsedPermission and PermissionInfo
to keep track of the same set of information. Since we only need to
support getPermissionInfo(), we can keep track of the information with
PermissionInfo alone, dropping dependency on ParsedPermission which
isn't and won't be an API.
The logic of addToTree() and updateDynamicPermission() became a bit
weird/broken after the package parser refactoring regarding how the
new ParsedPermission/PermissionInfo was derived, so Pie BasePermission
implementation was taken as a reference for what the intended behavior
actually was.
Bug: 158736025
Test: presubmit
Change-Id: I414d43c3e98e9267d74de35eb62b7d1b6524a13f
We would like to expose package states and unstartable reasons to public
APIs. Two main users will be:
1) sys UI, which will display alert windows on top of a foreground app
when the package becomes unstartable, with different contents in the alert
window based on the reason code.
2) Play Store, which will collect package state change information which
will be used to determine future package delivery strategies.
Test: will add CTS tests.
BUG: 162600626
CTS-Coverage-Bug: 168925819
Change-Id: I71bafb36b230ea93b34e8556b57563e4ba3b837d
Bug: 157149018
Test: WindowLayoutAffinity shows up for activities that set this
attribute (android:windowLayoutAffinity in layout).
Change-Id: I36bce99e146992b6ecf6c7be1065ae1603a0fae7
Exposing package state changes and progress changes via LauncherApps
and LauncherActivityInfo as public APIs.
BUG: 165841645
Test: builds (will add CTS tests)
CTS-Coverage-Bug: 168925573
Change-Id: I2b5ea698799f9a762b7d9c79d62636d3db187c1f
Fixes: 168260114
Test: refactoring, manually enabled security logs, compared with the previous version
Change-Id: I36f4939386b57130767860c13ea2816873f9f46a
* changes:
Upgrade AndroidFrameworkBinderIdentity to fatal.
Tighten up Binder.clearCallingIdentity() usage.
Tighten up Binder.clearCallingIdentity() usage.
Tighten up Binder.clearCallingIdentity() usage.
This is a third CL in a chain that adjusts existing malformed code
to follow AndroidFrameworkBinderIdentity best-practices.
Specifically, if a thread clears an identity they need to restore it
to avoid obscure security vulnerabilities. In addition, the relevant
"try" block must start immediately after the identity is cleared to
ensure that its restored if/when any exceptions are thrown.
Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
Introducing 'required-feature' and 'requred-not-feature' tags that could
be used "inside" 'uses-permission' elements.
Elements of both types should have non-empty 'android:name' attribute to
specify the name of the feature.
If the 'uses-permission' element contains 'required-feature' and/or
'required-not-feature' elements, the permission will only be "requested"
if the system supports all the 'required-feature's and does not support
any of the 'required-not-feature's.
The new elemets are "replacement" of the existing
'android:required(Not)Feature' attributes that can be optionally added
to 'uses-permission' elements, but allow to specify only 1 feature each.
However the 'android:required(Not)Feature' attributes remain supported
for compatibility and will be treated similarly to the
'require-(not-)feature' elements.
Bug: 168079571
Test: make && flash
Test: atest CtsContentTestCases:PermissionFeatureTest
Change-Id: Id3043530ebac6bd11805a611cebbf08b45e12f68
Introduce a new extra field for ACTION_PACKAGE_REMOVED intent to
signal that the application was removed automatically without the
user-initiated action.
If the system automatically prunes a package [eg. an instant app], we
mark the broadcast with that information. Launchers or other applications
can use this information to potentially alter their behaviour.
Bug: 111318529
Test: atest CtsAppSecurityHostTestCases:EphemeralTest
Change-Id: I3a4690d7df6e2dce10b246fe20a627ba2eed5da0