Skip to content
Commit 3e1776c6 authored by Felka Chang's avatar Felka Chang
Browse files

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
parent faf7e4a0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment