diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-12-15 15:53:17 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-12-15 22:06:10 -0800 |
commit | 7c74e4ae641e76f73d74348e293c244a157f6585 (patch) | |
tree | 52f84297787842137b3bd1818bc0d5f723d1e3ab /tests | |
parent | 338dee9dd7a7b087bf182f16970c16ffd940b435 (diff) | |
download | packages_apps_Trebuchet-7c74e4ae641e76f73d74348e293c244a157f6585.tar.gz packages_apps_Trebuchet-7c74e4ae641e76f73d74348e293c244a157f6585.tar.bz2 packages_apps_Trebuchet-7c74e4ae641e76f73d74348e293c244a157f6585.zip |
No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
Diffstat (limited to 'tests')
5 files changed, 15 insertions, 14 deletions
diff --git a/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java b/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java index 5628e8291..f23a574e9 100644 --- a/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java +++ b/tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java @@ -6,6 +6,8 @@ import android.content.Intent; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; +import android.os.Process; +import android.os.UserHandle; import android.support.test.InstrumentationRegistry; import android.test.ProviderTestCase2; @@ -17,10 +19,9 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.ItemInfo; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; -import com.android.launcher3.LauncherModel.Callbacks; import com.android.launcher3.LauncherModel.BaseModelUpdateTask; +import com.android.launcher3.LauncherModel.Callbacks; import com.android.launcher3.compat.LauncherActivityInfoCompat; -import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.TestLauncherProvider; @@ -46,7 +47,7 @@ public class BaseModelUpdateTaskTestCase extends ProviderTestCase2<TestLauncherP public final HashMap<Class, HashMap<String, Field>> fieldCache = new HashMap<>(); public Context targetContext; - public UserHandleCompat myUser; + public UserHandle myUser; public InvariantDeviceProfile idp; public LauncherAppState appState; @@ -66,7 +67,7 @@ public class BaseModelUpdateTaskTestCase extends ProviderTestCase2<TestLauncherP callbacks = mock(Callbacks.class); appState = mock(LauncherAppState.class); - myUser = UserHandleCompat.myUserHandle(); + myUser = Process.myUserHandle(); bgDataModel = new BgDataModel(); targetContext = InstrumentationRegistry.getTargetContext(); @@ -184,7 +185,7 @@ public class BaseModelUpdateTaskTestCase extends ProviderTestCase2<TestLauncherP @Override protected CacheEntry cacheLocked(ComponentName componentName, - LauncherActivityInfoCompat info, UserHandleCompat user, + LauncherActivityInfoCompat info, UserHandle user, boolean usePackageIcon, boolean useLowResIcon) { CacheEntry entry = mCache.get(new ComponentKey(componentName, user)); if (entry == null) { @@ -198,7 +199,7 @@ public class BaseModelUpdateTaskTestCase extends ProviderTestCase2<TestLauncherP CacheEntry entry = new CacheEntry(); entry.icon = newIcon(); entry.title = title; - mCache.put(new ComponentKey(key, UserHandleCompat.myUserHandle()), entry); + mCache.put(new ComponentKey(key, Process.myUserHandle()), entry); } public Bitmap newIcon() { diff --git a/tests/src/com/android/launcher3/ui/AllAppsAppLaunchTest.java b/tests/src/com/android/launcher3/ui/AllAppsAppLaunchTest.java index abe6b9591..4a80735bd 100644 --- a/tests/src/com/android/launcher3/ui/AllAppsAppLaunchTest.java +++ b/tests/src/com/android/launcher3/ui/AllAppsAppLaunchTest.java @@ -1,5 +1,6 @@ package com.android.launcher3.ui; +import android.os.Process; import android.support.test.uiautomator.By; import android.support.test.uiautomator.UiObject2; import android.support.test.uiautomator.Until; @@ -7,7 +8,6 @@ import android.test.suitebuilder.annotation.LargeTest; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.compat.LauncherAppsCompat; -import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.Condition; import com.android.launcher3.util.Wait; @@ -24,7 +24,7 @@ public class AllAppsAppLaunchTest extends LauncherInstrumentationTestCase { super.setUp(); mSettingsApp = LauncherAppsCompat.getInstance(mTargetContext) - .getActivityList("com.android.settings", UserHandleCompat.myUserHandle()).get(0); + .getActivityList("com.android.settings", Process.myUserHandle()).get(0); } public void testAppLauncher_portrait() throws Exception { diff --git a/tests/src/com/android/launcher3/ui/AllAppsIconToHomeTest.java b/tests/src/com/android/launcher3/ui/AllAppsIconToHomeTest.java index f45710c67..8837b0086 100644 --- a/tests/src/com/android/launcher3/ui/AllAppsIconToHomeTest.java +++ b/tests/src/com/android/launcher3/ui/AllAppsIconToHomeTest.java @@ -1,5 +1,6 @@ package com.android.launcher3.ui; +import android.os.Process; import android.support.test.uiautomator.By; import android.support.test.uiautomator.UiObject2; import android.support.test.uiautomator.Until; @@ -7,7 +8,6 @@ import android.test.suitebuilder.annotation.LargeTest; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.compat.LauncherAppsCompat; -import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.Condition; import com.android.launcher3.util.Wait; @@ -24,7 +24,7 @@ public class AllAppsIconToHomeTest extends LauncherInstrumentationTestCase { super.setUp(); mSettingsApp = LauncherAppsCompat.getInstance(mTargetContext) - .getActivityList("com.android.settings", UserHandleCompat.myUserHandle()).get(0); + .getActivityList("com.android.settings", Process.myUserHandle()).get(0); } public void testDragIcon_portrait() throws Throwable { diff --git a/tests/src/com/android/launcher3/ui/ShortcutsLaunchTest.java b/tests/src/com/android/launcher3/ui/ShortcutsLaunchTest.java index f892e6349..02d938cb2 100644 --- a/tests/src/com/android/launcher3/ui/ShortcutsLaunchTest.java +++ b/tests/src/com/android/launcher3/ui/ShortcutsLaunchTest.java @@ -1,6 +1,7 @@ package com.android.launcher3.ui; import android.graphics.Point; +import android.os.Process; import android.support.test.uiautomator.By; import android.support.test.uiautomator.UiObject2; import android.support.test.uiautomator.Until; @@ -10,7 +11,6 @@ import android.view.MotionEvent; import com.android.launcher3.R; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.compat.LauncherAppsCompat; -import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.Condition; import com.android.launcher3.util.Wait; @@ -27,7 +27,7 @@ public class ShortcutsLaunchTest extends LauncherInstrumentationTestCase { super.setUp(); mSettingsApp = LauncherAppsCompat.getInstance(mTargetContext) - .getActivityList("com.android.settings", UserHandleCompat.myUserHandle()).get(0); + .getActivityList("com.android.settings", Process.myUserHandle()).get(0); } public void testAppLauncher_portrait() throws Exception { diff --git a/tests/src/com/android/launcher3/ui/ShortcutsToHomeTest.java b/tests/src/com/android/launcher3/ui/ShortcutsToHomeTest.java index f9a0e6eaa..afe4832fd 100644 --- a/tests/src/com/android/launcher3/ui/ShortcutsToHomeTest.java +++ b/tests/src/com/android/launcher3/ui/ShortcutsToHomeTest.java @@ -1,6 +1,7 @@ package com.android.launcher3.ui; import android.graphics.Point; +import android.os.Process; import android.support.test.uiautomator.By; import android.support.test.uiautomator.UiObject2; import android.support.test.uiautomator.Until; @@ -10,7 +11,6 @@ import android.view.MotionEvent; import com.android.launcher3.R; import com.android.launcher3.compat.LauncherActivityInfoCompat; import com.android.launcher3.compat.LauncherAppsCompat; -import com.android.launcher3.compat.UserHandleCompat; import com.android.launcher3.util.Condition; import com.android.launcher3.util.Wait; @@ -27,7 +27,7 @@ public class ShortcutsToHomeTest extends LauncherInstrumentationTestCase { super.setUp(); mSettingsApp = LauncherAppsCompat.getInstance(mTargetContext) - .getActivityList("com.android.settings", UserHandleCompat.myUserHandle()).get(0); + .getActivityList("com.android.settings", Process.myUserHandle()).get(0); } public void testDragIcon_portrait() throws Throwable { |