Use client context to pass ShortcutManager tests
Uses client context in unit tests to pass the shortcut package name
check.
Before applying this change unit tests were failing with this error:
STACKTRACE:
junit.framework.AssertionFailedError: Expected exception type was
java.lang.IllegalArgumentException but caught
java.lang.SecurityException: Shortcut package name mismatch (message=)
at junit.framework.Assert.fail(Assert.java:50) at
junit.framework.Assert.assertTrue(Assert.java:20) at
com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils
.assertExpectException(ShortcutManagerTestUtils.java:429) at
com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils
.assertExpectException(ShortcutManagerTestUtils.java:410) at
com.android.server.pm.ShortcutManagerTest2
.testShortcutInfoMissingMandatoryFields(ShortcutManagerTest2.java:154)
Test: atest com.android.server.pm.ShortcutManagerTest1
Test: atest com.android.server.pm.ShortcutManagerTest2
Test: atest com.android.server.pm.ShortcutManagerTest3
Test: atest com.android.server.pm.ShortcutManagerTest4
Test: atest com.android.server.pm.ShortcutManagerTest5
Test: atest com.android.server.pm.ShortcutManagerTest6
Test: atest com.android.server.pm.ShortcutManagerTest7
Test: atest com.android.server.pm.ShortcutManagerTest8
Test: atest com.android.server.pm.ShortcutManagerTest9
Test: atest com.android.server.pm.ShortcutManagerTest10
Change-Id: I93e306dbcec206557da3f4c40cb12576e1ec8383
2 files changed