Loading services/tests/PackageManagerServiceTests/appenumeration/src/com/android/server/pm/test/appenumeration/AppEnumerationInternalTests.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.google.common.truth.Truth.assertThat; import android.app.AppGlobals; import android.app.AppGlobals; import android.app.PendingIntent; import android.app.PendingIntent; import android.app.UiAutomation; import android.content.Context; import android.content.Context; import android.content.IntentSender; import android.content.IntentSender; import android.content.pm.IPackageManager; import android.content.pm.IPackageManager; Loading Loading @@ -77,6 +78,8 @@ public class AppEnumerationInternalTests { @Before @Before public void setup() { public void setup() { mIPackageManager = AppGlobals.getPackageManager(); mIPackageManager = AppGlobals.getPackageManager(); getUiAutomation().adoptShellPermissionIdentity( "android.permission.INTERACT_ACROSS_USERS_FULL"); } } @After @After Loading @@ -84,6 +87,11 @@ public class AppEnumerationInternalTests { uninstallPackage(TARGET_SYNC_PROVIDER); uninstallPackage(TARGET_SYNC_PROVIDER); uninstallPackage(TARGET_HAS_APPOP_PERMISSION); uninstallPackage(TARGET_HAS_APPOP_PERMISSION); uninstallPackage(TARGET_SHARED_USER); uninstallPackage(TARGET_SHARED_USER); getUiAutomation().dropShellPermissionIdentity(); } private static UiAutomation getUiAutomation() { return InstrumentationRegistry.getInstrumentation().getUiAutomation(); } } @Test @Test Loading Loading
services/tests/PackageManagerServiceTests/appenumeration/src/com/android/server/pm/test/appenumeration/AppEnumerationInternalTests.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.google.common.truth.Truth.assertThat; import android.app.AppGlobals; import android.app.AppGlobals; import android.app.PendingIntent; import android.app.PendingIntent; import android.app.UiAutomation; import android.content.Context; import android.content.Context; import android.content.IntentSender; import android.content.IntentSender; import android.content.pm.IPackageManager; import android.content.pm.IPackageManager; Loading Loading @@ -77,6 +78,8 @@ public class AppEnumerationInternalTests { @Before @Before public void setup() { public void setup() { mIPackageManager = AppGlobals.getPackageManager(); mIPackageManager = AppGlobals.getPackageManager(); getUiAutomation().adoptShellPermissionIdentity( "android.permission.INTERACT_ACROSS_USERS_FULL"); } } @After @After Loading @@ -84,6 +87,11 @@ public class AppEnumerationInternalTests { uninstallPackage(TARGET_SYNC_PROVIDER); uninstallPackage(TARGET_SYNC_PROVIDER); uninstallPackage(TARGET_HAS_APPOP_PERMISSION); uninstallPackage(TARGET_HAS_APPOP_PERMISSION); uninstallPackage(TARGET_SHARED_USER); uninstallPackage(TARGET_SHARED_USER); getUiAutomation().dropShellPermissionIdentity(); } private static UiAutomation getUiAutomation() { return InstrumentationRegistry.getInstrumentation().getUiAutomation(); } } @Test @Test Loading