Search in sources :

Example 1 with R

use of com.android.frameworks.servicestests.R in project platform_frameworks_base by android.

the class ShortcutManagerTest1 method testManifestShortcuts_checkAllFields.

public void testManifestShortcuts_checkAllFields() {
    mService.handleUnlockUser(USER_0);
    // Package 1 updated, which has one valid manifest shortcut and one invalid.
    addManifestShortcutResource(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), R.xml.shortcut_5);
    updatePackageVersion(CALLING_PACKAGE_1, 1);
    mService.mPackageMonitor.onReceive(getTestContext(), genPackageAddIntent(CALLING_PACKAGE_1, USER_0));
    // Only the valid one is published.
    runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
        assertWith(getCallerShortcuts()).haveIds("ms1", "ms2", "ms3", "ms4", "ms5").areAllManifest().areAllImmutable().areAllEnabled().areAllNotPinned().areAllNotDynamic().forShortcutWithId("ms1", si -> {
            assertEquals(R.drawable.icon1, si.getIconResourceId());
            assertEquals(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), si.getActivity());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(R.string.shortcut_text1, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text1, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message1, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message1, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation", "android.shortcut.media"), si.getCategories());
            assertEquals("action1", si.getIntent().getAction());
            assertEquals(Uri.parse("http://a.b.c/1"), si.getIntent().getData());
        }).forShortcutWithId("ms2", si -> {
            assertEquals("ms2", si.getId());
            assertEquals(R.drawable.icon2, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(R.string.shortcut_text2, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text2, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message2, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation"), si.getCategories());
            assertEquals("action2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms3", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEmpty(si.getCategories());
            assertEquals("android.intent.action.VIEW", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms4", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEquals(set("cat"), si.getCategories());
            assertEquals("android.intent.action.VIEW2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms5", si -> {
            si = getCallerShortcut("ms5");
            assertEquals("action", si.getIntent().getAction());
            assertEquals("http://www/", si.getIntent().getData().toString());
            assertEquals("foo/bar", si.getIntent().getType());
            assertEquals(new ComponentName("abc", ".xyz"), si.getIntent().getComponent());
            assertEquals(set("cat1", "cat2"), si.getIntent().getCategories());
            assertEquals("value1", si.getIntent().getStringExtra("key1"));
            assertEquals("value2", si.getIntent().getStringExtra("key2"));
        });
    });
}
Also used : ShortcutManagerTestUtils.filterByActivity(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.filterByActivity) ShortcutManagerTestUtils.assertAllManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllManifest) Bundle(android.os.Bundle) Uri(android.net.Uri) ConfigConstants(com.android.server.pm.ShortcutService.ConfigConstants) Process(android.os.Process) ShortcutManagerTestUtils.assertAllHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveIntents) ShortcutManagerTestUtils.set(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.set) ShortcutManagerTestUtils.assertWith(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertWith) Matchers.eq(org.mockito.Matchers.eq) Locale(java.util.Locale) ShortcutManagerTestUtils.assertAllDynamicOrPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamicOrPinned) Handler(android.os.Handler) Looper(android.os.Looper) Matchers.anyInt(org.mockito.Matchers.anyInt) R(com.android.frameworks.servicestests.R) ShortcutManagerTestUtils.assertAllDisabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDisabled) Mockito.doReturn(org.mockito.Mockito.doReturn) ShortcutManagerTestUtils.assertAllNotManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotManifest) Log(android.util.Log) ShortcutManagerTestUtils.assertAllEnabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllEnabled) ShortcutManagerTestUtils.assertAllNotHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveIntents) ShortcutManagerTestUtils.assertCallbackNotReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackNotReceived) FileOutputStreamWithPath(com.android.server.pm.ShortcutService.FileOutputStreamWithPath) ShortcutManagerTestUtils.waitOnMainThread(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.waitOnMainThread) Matchers.any(org.mockito.Matchers.any) LauncherApps(android.content.pm.LauncherApps) SparseArray(android.util.SparseArray) List(java.util.List) ShortcutManagerTestUtils.assertDynamicOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicOnly) ShortcutManagerTestUtils.findShortcut(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.findShortcut) ActivityNotFoundException(android.content.ActivityNotFoundException) ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery) ShortcutManagerTestUtils.assertDynamicAndPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicAndPinned) ApplicationInfo(android.content.pm.ApplicationInfo) ShortcutManagerTestUtils.assertAllUnique(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllUnique) Mockito.mock(org.mockito.Mockito.mock) ShortcutManagerTestUtils.assertForLauncherCallback(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertForLauncherCallback) ActivityManager(android.app.ActivityManager) SmallTest(android.test.suitebuilder.annotation.SmallTest) ShortcutManagerTestUtils.assertAllNotHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveTitle) Intent(android.content.Intent) BitmapFactory(android.graphics.BitmapFactory) ShortcutManagerTestUtils.pfdToBitmap(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.pfdToBitmap) ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded) PackageWithUser(com.android.server.pm.ShortcutUser.PackageWithUser) ShortcutManagerTestUtils.assertEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertEmpty) Matchers.anyString(org.mockito.Matchers.anyString) ShortcutManagerTestUtils.assertExpectException(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertExpectException) ArgumentCaptor(org.mockito.ArgumentCaptor) ShortcutManagerTestUtils.assertBitmapSize(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBitmapSize) UserHandle(android.os.UserHandle) ShortcutManagerTestUtils.assertAllDynamic(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamic) ShortcutManagerTestUtils.assertCallbackReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackReceived) ShortcutManagerTestUtils.resetAll(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.resetAll) Icon(android.graphics.drawable.Icon) ShortcutManagerTestUtils.assertAllImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllImmutable) ShortcutManagerTestUtils.assertShortcutIds(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertShortcutIds) ShortcutManagerTestUtils.assertAllHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveTitle) ShortcutManagerTestUtils.list(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list) ComponentName(android.content.ComponentName) ShortcutInfo(android.content.pm.ShortcutInfo) ShortcutManagerTestUtils.makeBundle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.makeBundle) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly) File(java.io.File) Mockito.verify(org.mockito.Mockito.verify) ShortcutManagerTestUtils.assertBundleEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBundleEmpty) ShortcutManagerTestUtils.assertAllPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllPinned) ShortcutManagerTestUtils.hashSet(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.hashSet) ShortcutManagerTestUtils.assertCannotUpdateImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCannotUpdateImmutable) Bitmap(android.graphics.Bitmap) CompressFormat(android.graphics.Bitmap.CompressFormat) Manifest.permission(android.Manifest.permission) ShortcutManagerTestUtils.assertAllKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllKeyFieldsOnly) Mockito.reset(org.mockito.Mockito.reset) ComponentName(android.content.ComponentName)

Example 2 with R

use of com.android.frameworks.servicestests.R in project android_frameworks_base by DirtyUnicorns.

the class ShortcutManagerTest1 method testManifestShortcuts_checkAllFields.

public void testManifestShortcuts_checkAllFields() {
    mService.handleUnlockUser(USER_0);
    // Package 1 updated, which has one valid manifest shortcut and one invalid.
    addManifestShortcutResource(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), R.xml.shortcut_5);
    updatePackageVersion(CALLING_PACKAGE_1, 1);
    mService.mPackageMonitor.onReceive(getTestContext(), genPackageAddIntent(CALLING_PACKAGE_1, USER_0));
    // Only the valid one is published.
    runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
        assertWith(getCallerShortcuts()).haveIds("ms1", "ms2", "ms3", "ms4", "ms5").areAllManifest().areAllImmutable().areAllEnabled().areAllNotPinned().areAllNotDynamic().forShortcutWithId("ms1", si -> {
            assertEquals(R.drawable.icon1, si.getIconResourceId());
            assertEquals(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), si.getActivity());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(R.string.shortcut_text1, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text1, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message1, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message1, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation", "android.shortcut.media"), si.getCategories());
            assertEquals("action1", si.getIntent().getAction());
            assertEquals(Uri.parse("http://a.b.c/1"), si.getIntent().getData());
        }).forShortcutWithId("ms2", si -> {
            assertEquals("ms2", si.getId());
            assertEquals(R.drawable.icon2, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(R.string.shortcut_text2, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text2, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message2, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation"), si.getCategories());
            assertEquals("action2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms3", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEmpty(si.getCategories());
            assertEquals("android.intent.action.VIEW", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms4", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEquals(set("cat"), si.getCategories());
            assertEquals("android.intent.action.VIEW2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms5", si -> {
            si = getCallerShortcut("ms5");
            assertEquals("action", si.getIntent().getAction());
            assertEquals("http://www/", si.getIntent().getData().toString());
            assertEquals("foo/bar", si.getIntent().getType());
            assertEquals(new ComponentName("abc", ".xyz"), si.getIntent().getComponent());
            assertEquals(set("cat1", "cat2"), si.getIntent().getCategories());
            assertEquals("value1", si.getIntent().getStringExtra("key1"));
            assertEquals("value2", si.getIntent().getStringExtra("key2"));
        });
    });
}
Also used : ShortcutManagerTestUtils.filterByActivity(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.filterByActivity) ShortcutManagerTestUtils.assertAllManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllManifest) Bundle(android.os.Bundle) Uri(android.net.Uri) ConfigConstants(com.android.server.pm.ShortcutService.ConfigConstants) Process(android.os.Process) ShortcutManagerTestUtils.assertAllHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveIntents) ShortcutManagerTestUtils.set(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.set) ShortcutManagerTestUtils.assertWith(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertWith) Matchers.eq(org.mockito.Matchers.eq) Locale(java.util.Locale) ShortcutManagerTestUtils.assertAllDynamicOrPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamicOrPinned) Handler(android.os.Handler) Looper(android.os.Looper) Matchers.anyInt(org.mockito.Matchers.anyInt) R(com.android.frameworks.servicestests.R) ShortcutManagerTestUtils.assertAllDisabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDisabled) Mockito.doReturn(org.mockito.Mockito.doReturn) ShortcutManagerTestUtils.assertAllNotManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotManifest) Log(android.util.Log) ShortcutManagerTestUtils.assertAllEnabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllEnabled) ShortcutManagerTestUtils.assertAllNotHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveIntents) ShortcutManagerTestUtils.assertCallbackNotReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackNotReceived) FileOutputStreamWithPath(com.android.server.pm.ShortcutService.FileOutputStreamWithPath) ShortcutManagerTestUtils.waitOnMainThread(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.waitOnMainThread) Matchers.any(org.mockito.Matchers.any) LauncherApps(android.content.pm.LauncherApps) SparseArray(android.util.SparseArray) List(java.util.List) ShortcutManagerTestUtils.assertDynamicOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicOnly) ShortcutManagerTestUtils.findShortcut(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.findShortcut) ActivityNotFoundException(android.content.ActivityNotFoundException) ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery) ShortcutManagerTestUtils.assertDynamicAndPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicAndPinned) ApplicationInfo(android.content.pm.ApplicationInfo) ShortcutManagerTestUtils.assertAllUnique(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllUnique) Mockito.mock(org.mockito.Mockito.mock) ShortcutManagerTestUtils.assertForLauncherCallback(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertForLauncherCallback) ActivityManager(android.app.ActivityManager) SmallTest(android.test.suitebuilder.annotation.SmallTest) ShortcutManagerTestUtils.assertAllNotHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveTitle) Intent(android.content.Intent) BitmapFactory(android.graphics.BitmapFactory) ShortcutManagerTestUtils.pfdToBitmap(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.pfdToBitmap) ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded) PackageWithUser(com.android.server.pm.ShortcutUser.PackageWithUser) ShortcutManagerTestUtils.assertEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertEmpty) Matchers.anyString(org.mockito.Matchers.anyString) ShortcutManagerTestUtils.assertExpectException(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertExpectException) ArgumentCaptor(org.mockito.ArgumentCaptor) ShortcutManagerTestUtils.assertBitmapSize(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBitmapSize) UserHandle(android.os.UserHandle) ShortcutManagerTestUtils.assertAllDynamic(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamic) ShortcutManagerTestUtils.assertCallbackReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackReceived) ShortcutManagerTestUtils.resetAll(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.resetAll) Icon(android.graphics.drawable.Icon) ShortcutManagerTestUtils.assertAllImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllImmutable) ShortcutManagerTestUtils.assertShortcutIds(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertShortcutIds) ShortcutManagerTestUtils.assertAllHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveTitle) ShortcutManagerTestUtils.list(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list) ComponentName(android.content.ComponentName) ShortcutInfo(android.content.pm.ShortcutInfo) ShortcutManagerTestUtils.makeBundle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.makeBundle) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly) File(java.io.File) Mockito.verify(org.mockito.Mockito.verify) ShortcutManagerTestUtils.assertBundleEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBundleEmpty) ShortcutManagerTestUtils.assertAllPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllPinned) ShortcutManagerTestUtils.hashSet(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.hashSet) ShortcutManagerTestUtils.assertCannotUpdateImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCannotUpdateImmutable) Bitmap(android.graphics.Bitmap) CompressFormat(android.graphics.Bitmap.CompressFormat) Manifest.permission(android.Manifest.permission) ShortcutManagerTestUtils.assertAllKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllKeyFieldsOnly) Mockito.reset(org.mockito.Mockito.reset) ComponentName(android.content.ComponentName)

Example 3 with R

use of com.android.frameworks.servicestests.R in project android_frameworks_base by ResurrectionRemix.

the class ShortcutManagerTest1 method testManifestShortcuts_checkAllFields.

public void testManifestShortcuts_checkAllFields() {
    mService.handleUnlockUser(USER_0);
    // Package 1 updated, which has one valid manifest shortcut and one invalid.
    addManifestShortcutResource(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), R.xml.shortcut_5);
    updatePackageVersion(CALLING_PACKAGE_1, 1);
    mService.mPackageMonitor.onReceive(getTestContext(), genPackageAddIntent(CALLING_PACKAGE_1, USER_0));
    // Only the valid one is published.
    runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
        assertWith(getCallerShortcuts()).haveIds("ms1", "ms2", "ms3", "ms4", "ms5").areAllManifest().areAllImmutable().areAllEnabled().areAllNotPinned().areAllNotDynamic().forShortcutWithId("ms1", si -> {
            assertEquals(R.drawable.icon1, si.getIconResourceId());
            assertEquals(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), si.getActivity());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(R.string.shortcut_text1, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text1, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message1, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message1, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation", "android.shortcut.media"), si.getCategories());
            assertEquals("action1", si.getIntent().getAction());
            assertEquals(Uri.parse("http://a.b.c/1"), si.getIntent().getData());
        }).forShortcutWithId("ms2", si -> {
            assertEquals("ms2", si.getId());
            assertEquals(R.drawable.icon2, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(R.string.shortcut_text2, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text2, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message2, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation"), si.getCategories());
            assertEquals("action2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms3", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEmpty(si.getCategories());
            assertEquals("android.intent.action.VIEW", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms4", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEquals(set("cat"), si.getCategories());
            assertEquals("android.intent.action.VIEW2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms5", si -> {
            si = getCallerShortcut("ms5");
            assertEquals("action", si.getIntent().getAction());
            assertEquals("http://www/", si.getIntent().getData().toString());
            assertEquals("foo/bar", si.getIntent().getType());
            assertEquals(new ComponentName("abc", ".xyz"), si.getIntent().getComponent());
            assertEquals(set("cat1", "cat2"), si.getIntent().getCategories());
            assertEquals("value1", si.getIntent().getStringExtra("key1"));
            assertEquals("value2", si.getIntent().getStringExtra("key2"));
        });
    });
}
Also used : ShortcutManagerTestUtils.filterByActivity(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.filterByActivity) ShortcutManagerTestUtils.assertAllManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllManifest) Bundle(android.os.Bundle) Uri(android.net.Uri) ConfigConstants(com.android.server.pm.ShortcutService.ConfigConstants) Process(android.os.Process) ShortcutManagerTestUtils.assertAllHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveIntents) ShortcutManagerTestUtils.set(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.set) ShortcutManagerTestUtils.assertWith(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertWith) Matchers.eq(org.mockito.Matchers.eq) Locale(java.util.Locale) ShortcutManagerTestUtils.assertAllDynamicOrPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamicOrPinned) Handler(android.os.Handler) Looper(android.os.Looper) Matchers.anyInt(org.mockito.Matchers.anyInt) R(com.android.frameworks.servicestests.R) ShortcutManagerTestUtils.assertAllDisabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDisabled) Mockito.doReturn(org.mockito.Mockito.doReturn) ShortcutManagerTestUtils.assertAllNotManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotManifest) Log(android.util.Log) ShortcutManagerTestUtils.assertAllEnabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllEnabled) ShortcutManagerTestUtils.assertAllNotHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveIntents) ShortcutManagerTestUtils.assertCallbackNotReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackNotReceived) FileOutputStreamWithPath(com.android.server.pm.ShortcutService.FileOutputStreamWithPath) ShortcutManagerTestUtils.waitOnMainThread(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.waitOnMainThread) Matchers.any(org.mockito.Matchers.any) LauncherApps(android.content.pm.LauncherApps) SparseArray(android.util.SparseArray) List(java.util.List) ShortcutManagerTestUtils.assertDynamicOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicOnly) ShortcutManagerTestUtils.findShortcut(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.findShortcut) ActivityNotFoundException(android.content.ActivityNotFoundException) ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery) ShortcutManagerTestUtils.assertDynamicAndPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicAndPinned) ApplicationInfo(android.content.pm.ApplicationInfo) ShortcutManagerTestUtils.assertAllUnique(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllUnique) Mockito.mock(org.mockito.Mockito.mock) ShortcutManagerTestUtils.assertForLauncherCallback(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertForLauncherCallback) ActivityManager(android.app.ActivityManager) SmallTest(android.test.suitebuilder.annotation.SmallTest) ShortcutManagerTestUtils.assertAllNotHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveTitle) Intent(android.content.Intent) BitmapFactory(android.graphics.BitmapFactory) ShortcutManagerTestUtils.pfdToBitmap(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.pfdToBitmap) ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded) PackageWithUser(com.android.server.pm.ShortcutUser.PackageWithUser) ShortcutManagerTestUtils.assertEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertEmpty) Matchers.anyString(org.mockito.Matchers.anyString) ShortcutManagerTestUtils.assertExpectException(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertExpectException) ArgumentCaptor(org.mockito.ArgumentCaptor) ShortcutManagerTestUtils.assertBitmapSize(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBitmapSize) UserHandle(android.os.UserHandle) ShortcutManagerTestUtils.assertAllDynamic(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamic) ShortcutManagerTestUtils.assertCallbackReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackReceived) ShortcutManagerTestUtils.resetAll(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.resetAll) Icon(android.graphics.drawable.Icon) ShortcutManagerTestUtils.assertAllImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllImmutable) ShortcutManagerTestUtils.assertShortcutIds(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertShortcutIds) ShortcutManagerTestUtils.assertAllHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveTitle) ShortcutManagerTestUtils.list(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list) ComponentName(android.content.ComponentName) ShortcutInfo(android.content.pm.ShortcutInfo) ShortcutManagerTestUtils.makeBundle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.makeBundle) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly) File(java.io.File) Mockito.verify(org.mockito.Mockito.verify) ShortcutManagerTestUtils.assertBundleEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBundleEmpty) ShortcutManagerTestUtils.assertAllPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllPinned) ShortcutManagerTestUtils.hashSet(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.hashSet) ShortcutManagerTestUtils.assertCannotUpdateImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCannotUpdateImmutable) Bitmap(android.graphics.Bitmap) CompressFormat(android.graphics.Bitmap.CompressFormat) Manifest.permission(android.Manifest.permission) ShortcutManagerTestUtils.assertAllKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllKeyFieldsOnly) Mockito.reset(org.mockito.Mockito.reset) ComponentName(android.content.ComponentName)

Example 4 with R

use of com.android.frameworks.servicestests.R in project android_frameworks_base by crdroidandroid.

the class ShortcutManagerTest1 method testManifestShortcuts_checkAllFields.

public void testManifestShortcuts_checkAllFields() {
    mService.handleUnlockUser(USER_0);
    // Package 1 updated, which has one valid manifest shortcut and one invalid.
    addManifestShortcutResource(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), R.xml.shortcut_5);
    updatePackageVersion(CALLING_PACKAGE_1, 1);
    mService.mPackageMonitor.onReceive(getTestContext(), genPackageAddIntent(CALLING_PACKAGE_1, USER_0));
    // Only the valid one is published.
    runWithCaller(CALLING_PACKAGE_1, USER_0, () -> {
        assertWith(getCallerShortcuts()).haveIds("ms1", "ms2", "ms3", "ms4", "ms5").areAllManifest().areAllImmutable().areAllEnabled().areAllNotPinned().areAllNotDynamic().forShortcutWithId("ms1", si -> {
            assertEquals(R.drawable.icon1, si.getIconResourceId());
            assertEquals(new ComponentName(CALLING_PACKAGE_1, ShortcutActivity.class.getName()), si.getActivity());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(R.string.shortcut_text1, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text1, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message1, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message1, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation", "android.shortcut.media"), si.getCategories());
            assertEquals("action1", si.getIntent().getAction());
            assertEquals(Uri.parse("http://a.b.c/1"), si.getIntent().getData());
        }).forShortcutWithId("ms2", si -> {
            assertEquals("ms2", si.getId());
            assertEquals(R.drawable.icon2, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(R.string.shortcut_text2, si.getTextResId());
            assertEquals("r" + R.string.shortcut_text2, si.getTextResName());
            assertEquals(R.string.shortcut_disabled_message2, si.getDisabledMessageResourceId());
            assertEquals("r" + R.string.shortcut_disabled_message2, si.getDisabledMessageResName());
            assertEquals(set("android.shortcut.conversation"), si.getCategories());
            assertEquals("action2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms3", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title1, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title1, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEmpty(si.getCategories());
            assertEquals("android.intent.action.VIEW", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms4", si -> {
            assertEquals(0, si.getIconResourceId());
            assertEquals(R.string.shortcut_title2, si.getTitleResId());
            assertEquals("r" + R.string.shortcut_title2, si.getTitleResName());
            assertEquals(0, si.getTextResId());
            assertEquals(null, si.getTextResName());
            assertEquals(0, si.getDisabledMessageResourceId());
            assertEquals(null, si.getDisabledMessageResName());
            assertEquals(set("cat"), si.getCategories());
            assertEquals("android.intent.action.VIEW2", si.getIntent().getAction());
            assertEquals(null, si.getIntent().getData());
        }).forShortcutWithId("ms5", si -> {
            si = getCallerShortcut("ms5");
            assertEquals("action", si.getIntent().getAction());
            assertEquals("http://www/", si.getIntent().getData().toString());
            assertEquals("foo/bar", si.getIntent().getType());
            assertEquals(new ComponentName("abc", ".xyz"), si.getIntent().getComponent());
            assertEquals(set("cat1", "cat2"), si.getIntent().getCategories());
            assertEquals("value1", si.getIntent().getStringExtra("key1"));
            assertEquals("value2", si.getIntent().getStringExtra("key2"));
        });
    });
}
Also used : ShortcutManagerTestUtils.filterByActivity(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.filterByActivity) ShortcutManagerTestUtils.assertAllManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllManifest) Bundle(android.os.Bundle) Uri(android.net.Uri) ConfigConstants(com.android.server.pm.ShortcutService.ConfigConstants) Process(android.os.Process) ShortcutManagerTestUtils.assertAllHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveIntents) ShortcutManagerTestUtils.set(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.set) ShortcutManagerTestUtils.assertWith(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertWith) Matchers.eq(org.mockito.Matchers.eq) Locale(java.util.Locale) ShortcutManagerTestUtils.assertAllDynamicOrPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamicOrPinned) Handler(android.os.Handler) Looper(android.os.Looper) Matchers.anyInt(org.mockito.Matchers.anyInt) R(com.android.frameworks.servicestests.R) ShortcutManagerTestUtils.assertAllDisabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDisabled) Mockito.doReturn(org.mockito.Mockito.doReturn) ShortcutManagerTestUtils.assertAllNotManifest(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotManifest) Log(android.util.Log) ShortcutManagerTestUtils.assertAllEnabled(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllEnabled) ShortcutManagerTestUtils.assertAllNotHaveIntents(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveIntents) ShortcutManagerTestUtils.assertCallbackNotReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackNotReceived) FileOutputStreamWithPath(com.android.server.pm.ShortcutService.FileOutputStreamWithPath) ShortcutManagerTestUtils.waitOnMainThread(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.waitOnMainThread) Matchers.any(org.mockito.Matchers.any) LauncherApps(android.content.pm.LauncherApps) SparseArray(android.util.SparseArray) List(java.util.List) ShortcutManagerTestUtils.assertDynamicOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicOnly) ShortcutManagerTestUtils.findShortcut(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.findShortcut) ActivityNotFoundException(android.content.ActivityNotFoundException) ShortcutQuery(android.content.pm.LauncherApps.ShortcutQuery) ShortcutManagerTestUtils.assertDynamicAndPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicAndPinned) ApplicationInfo(android.content.pm.ApplicationInfo) ShortcutManagerTestUtils.assertAllUnique(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllUnique) Mockito.mock(org.mockito.Mockito.mock) ShortcutManagerTestUtils.assertForLauncherCallback(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertForLauncherCallback) ActivityManager(android.app.ActivityManager) SmallTest(android.test.suitebuilder.annotation.SmallTest) ShortcutManagerTestUtils.assertAllNotHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotHaveTitle) Intent(android.content.Intent) BitmapFactory(android.graphics.BitmapFactory) ShortcutManagerTestUtils.pfdToBitmap(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.pfdToBitmap) ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertDynamicShortcutCountExceeded) PackageWithUser(com.android.server.pm.ShortcutUser.PackageWithUser) ShortcutManagerTestUtils.assertEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertEmpty) Matchers.anyString(org.mockito.Matchers.anyString) ShortcutManagerTestUtils.assertExpectException(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertExpectException) ArgumentCaptor(org.mockito.ArgumentCaptor) ShortcutManagerTestUtils.assertBitmapSize(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBitmapSize) UserHandle(android.os.UserHandle) ShortcutManagerTestUtils.assertAllDynamic(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllDynamic) ShortcutManagerTestUtils.assertCallbackReceived(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCallbackReceived) ShortcutManagerTestUtils.resetAll(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.resetAll) Icon(android.graphics.drawable.Icon) ShortcutManagerTestUtils.assertAllImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllImmutable) ShortcutManagerTestUtils.assertShortcutIds(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertShortcutIds) ShortcutManagerTestUtils.assertAllHaveTitle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllHaveTitle) ShortcutManagerTestUtils.list(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.list) ComponentName(android.content.ComponentName) ShortcutInfo(android.content.pm.ShortcutInfo) ShortcutManagerTestUtils.makeBundle(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.makeBundle) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllNotKeyFieldsOnly) File(java.io.File) Mockito.verify(org.mockito.Mockito.verify) ShortcutManagerTestUtils.assertBundleEmpty(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertBundleEmpty) ShortcutManagerTestUtils.assertAllPinned(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllPinned) ShortcutManagerTestUtils.hashSet(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.hashSet) ShortcutManagerTestUtils.assertCannotUpdateImmutable(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertCannotUpdateImmutable) Bitmap(android.graphics.Bitmap) CompressFormat(android.graphics.Bitmap.CompressFormat) Manifest.permission(android.Manifest.permission) ShortcutManagerTestUtils.assertAllKeyFieldsOnly(com.android.server.pm.shortcutmanagertest.ShortcutManagerTestUtils.assertAllKeyFieldsOnly) Mockito.reset(org.mockito.Mockito.reset) ComponentName(android.content.ComponentName)

Aggregations

Manifest.permission (android.Manifest.permission)4 ActivityManager (android.app.ActivityManager)4 ActivityNotFoundException (android.content.ActivityNotFoundException)4 ComponentName (android.content.ComponentName)4 Intent (android.content.Intent)4 ApplicationInfo (android.content.pm.ApplicationInfo)4 LauncherApps (android.content.pm.LauncherApps)4 ShortcutQuery (android.content.pm.LauncherApps.ShortcutQuery)4 ShortcutInfo (android.content.pm.ShortcutInfo)4 Bitmap (android.graphics.Bitmap)4 CompressFormat (android.graphics.Bitmap.CompressFormat)4 BitmapFactory (android.graphics.BitmapFactory)4 Icon (android.graphics.drawable.Icon)4 Uri (android.net.Uri)4 Bundle (android.os.Bundle)4 Handler (android.os.Handler)4 Looper (android.os.Looper)4 Process (android.os.Process)4 UserHandle (android.os.UserHandle)4 SmallTest (android.test.suitebuilder.annotation.SmallTest)4