/cts/tests/tests/permission/permissionTestUtilLib/src/android/permission/cts/ |
D | PermissionUtils.java | 80 public static int getAppOp(@NonNull String packageName, @NonNull String permission) in getAppOp() argument 85 sContext.getPackageManager().getPackageUid(packageName, 0), packageName)); in getAppOp() 102 public static void uninstallApp(@NonNull String packageName) { in uninstallApp() argument 103 runShellCommand("pm uninstall " + packageName); in uninstallApp() 113 public static void setAppOp(@NonNull String packageName, @NonNull String permission, int mode) { in setAppOp() argument 114 setAppOpByName(packageName, permissionToOp(permission), mode); in setAppOp() 124 public static void setAppOpByName(@NonNull String packageName, @NonNull String op, int mode) { in setAppOpByName() argument 127 sContext.getPackageManager().getPackageUid(packageName, 0), mode)); in setAppOpByName() 140 public static boolean isPermissionGranted(@NonNull String packageName, in isPermissionGranted() argument 143 sContext.getPackageManager().getPackageUid(packageName, 0)) in isPermissionGranted() [all …]
|
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/ |
D | AmUtils.java | 29 public static void runMakeUidIdle(String packageName) { in runMakeUidIdle() argument 30 SystemUtil.runShellCommandForNoOutput("am make-uid-idle " + packageName); in runMakeUidIdle() 34 public static void runKill(String packageName) throws Exception { in runKill() argument 35 runKill(packageName, false /* wait */); in runKill() 38 public static void runKill(String packageName, boolean wait) throws Exception { in runKill() argument 39 SystemUtil.runShellCommandForNoOutput("am kill --user cur " + packageName); in runKill() 45 TestUtils.waitUntil("package process was not killed:" + packageName, in runKill() 46 () -> !isProcessRunning(packageName)); in runKill() 49 private static boolean isProcessRunning(String packageName) { in isProcessRunning() argument 53 if (packages[i].equals(packageName)) { in isProcessRunning() [all …]
|
D | AppOpsUtils.java | 47 public static String reset(String packageName) throws IOException { in reset() argument 48 return runCommand("appops reset " + packageName); in reset() 54 public static String setOpMode(String packageName, String opStr, int mode) in setOpMode() argument 73 String command = "appops set " + packageName + " " + opStr + " " + modeStr; in setOpMode() 80 public static int getOpMode(String packageName, String opStr) in getOpMode() argument 82 String opState = getOpState(packageName, opStr); in getOpMode() 103 public static boolean allowedOperationLogged(String packageName, String opStr) in allowedOperationLogged() argument 105 return getOpState(packageName, opStr).contains(" time="); in allowedOperationLogged() 115 public static boolean rejectedOperationLogged(String packageName, String opStr) in rejectedOperationLogged() argument 117 return getOpState(packageName, opStr).contains(" rejectTime="); in rejectedOperationLogged() [all …]
|
D | PackageUtil.java | 41 public static boolean exists(String packageName) { in exists() argument 43 return (getPackageManager().getApplicationInfo(packageName, in exists() 51 public static boolean exists(String packageName, String sha) { in exists() argument 54 packageName, PackageManager.GET_META_DATA) == null) { in exists() 57 return sha.equals(computePackageSignatureDigest(packageName)); in exists() 64 public static boolean isSystemApp(String packageName) { in isSystemApp() argument 66 ApplicationInfo ai = getPackageManager().getApplicationInfo(packageName, in isSystemApp() 78 public static boolean isPrivilegedSystemApp(String packageName) { in isPrivilegedSystemApp() argument 80 ApplicationInfo ai = getPackageManager().getApplicationInfo(packageName, in isPrivilegedSystemApp() 89 public static String getVersionString(String packageName) { in getVersionString() argument [all …]
|
/cts/tests/tests/telecom/src/android/telecom/cts/ |
D | CtsRoleManagerAdapter.java | 63 public void addCompanionAppRoleHolder(String packageName) in addCompanionAppRoleHolder() argument 66 addRoleHolder(ROLE_COMPANION_APP, packageName); in addCompanionAppRoleHolder() 69 COMMAND_ADD_OR_REMOVE_CALL_COMPANION_APP, packageName, 1); in addCompanionAppRoleHolder() 71 addRoleHolderToMap(ROLE_COMPANION_APP, packageName); in addCompanionAppRoleHolder() 75 public void removeCompanionAppRoleHolder(String packageName) throws Exception { in removeCompanionAppRoleHolder() argument 77 removeRoleHolder(ROLE_COMPANION_APP, packageName); in removeCompanionAppRoleHolder() 80 COMMAND_ADD_OR_REMOVE_CALL_COMPANION_APP, packageName, 0); in removeCompanionAppRoleHolder() 82 removeRoleHolderFromMap(ROLE_COMPANION_APP, packageName); in removeCompanionAppRoleHolder() 86 public void addAutomotiveRoleHolder(String packageName) in addAutomotiveRoleHolder() argument 89 addRoleHolder(ROLE_CAR_MODE_DIALER_APP, packageName); in addAutomotiveRoleHolder() [all …]
|
/cts/common/device-side/util/src/com/android/compatibility/common/util/ |
D | AmUtils.java | 27 public static void runMakeUidIdle(String packageName) { in runMakeUidIdle() argument 28 SystemUtil.runShellCommandForNoOutput("am make-uid-idle " + packageName); in runMakeUidIdle() 32 public static void runKill(String packageName) throws Exception { in runKill() argument 33 runKill(packageName, false /* wait */); in runKill() 36 public static void runKill(String packageName, boolean wait) throws Exception { in runKill() argument 37 SystemUtil.runShellCommandForNoOutput("am kill --user cur " + packageName); in runKill() 43 TestUtils.waitUntil("package process was not killed:" + packageName, in runKill() 44 () -> !isProcessRunning(packageName)); in runKill() 47 private static boolean isProcessRunning(String packageName) { in isProcessRunning() argument 51 if (packages[i].equals(packageName)) { in isProcessRunning() [all …]
|
D | AppOpsUtils.java | 46 public static String reset(String packageName) throws IOException { in reset() argument 47 return runCommand("appops reset " + packageName); in reset() 53 public static String setOpMode(String packageName, String opStr, int mode) in setOpMode() argument 72 String command = "appops set " + packageName + " " + opStr + " " + modeStr; in setOpMode() 79 public static int getOpMode(String packageName, String opStr) in getOpMode() argument 81 String opState = getOpState(packageName, opStr); in getOpMode() 102 public static boolean allowedOperationLogged(String packageName, String opStr) in allowedOperationLogged() argument 104 return getOpState(packageName, opStr).contains(" time="); in allowedOperationLogged() 114 public static boolean rejectedOperationLogged(String packageName, String opStr) in rejectedOperationLogged() argument 116 return getOpState(packageName, opStr).contains(" rejectTime="); in rejectedOperationLogged() [all …]
|
D | PackageUtil.java | 41 public static boolean exists(String packageName) { in exists() argument 43 return (getPackageManager().getApplicationInfo(packageName, in exists() 51 public static boolean exists(String packageName, String sha) { in exists() argument 54 packageName, PackageManager.GET_META_DATA) == null) { in exists() 57 return sha.equals(computePackageSignatureDigest(packageName)); in exists() 64 public static boolean isSystemApp(String packageName) { in isSystemApp() argument 66 ApplicationInfo ai = getPackageManager().getApplicationInfo(packageName, in isSystemApp() 75 public static String getVersionString(String packageName) { in getVersionString() argument 77 PackageInfo info = getPackageManager().getPackageInfo(packageName, in getVersionString() 81 Log.w(TAG, "Could not find version string for package " + packageName); in getVersionString() [all …]
|
/cts/tests/tests/appop/src/android/app/appops/cts/ |
D | AppOpsUtils.kt | 45 fun reset(packageName: String): String { in reset() 46 return runCommand("appops reset $packageName") in reset() 52 fun setOpMode(packageName: String, opStr: String, mode: Int) : String { in setOpMode() 61 val command = "appops set $packageName $opStr $modeStr" in setOpMode() 68 fun getOpMode(packageName: String, opStr: String) : Int { in getOpMode() 69 val opState = getOpState(packageName, opStr) in getOpMode() 86 fun allowedOperationLogged(packageName: String, opStr: String): Boolean { in allowedOperationLogged() 87 return getOpState(packageName, opStr).contains(" time=") in allowedOperationLogged() 97 fun rejectedOperationLogged(packageName: String, opStr: String) : Boolean { in rejectedOperationLogged() 98 return getOpState(packageName, opStr).contains(" rejectTime=") in rejectedOperationLogged() [all …]
|
D | HistoricalAppopsTest.kt | 46 private var packageName: String? = null in <lambda>() variable in android.app.appops.cts.HistoricalAppopsTest 62 packageName = getContext().packageName in <lambda>() 120 val firstOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() 127 val secondOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() 134 val thirdOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() 162 val firstOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() 171 val secondOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() 181 val thirdOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() 190 val fourthOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() 195 val fifthOps = getHistoricalOpsFromDiskRaw(appOpsManager!!, uid, packageName!!, in <lambda>() [all …]
|
/cts/tests/security/src/android/keystore/cts/ |
D | AttestationPackageInfo.java | 28 private final String packageName; field in AttestationPackageInfo 31 public AttestationPackageInfo(String packageName, long version) { in AttestationPackageInfo() argument 32 this.packageName = packageName; in AttestationPackageInfo() 45 packageName = Asn1Utils.getStringFromAsn1OctetStreamAssumingUTF8( in AttestationPackageInfo() 56 return packageName; in getPackageName() 71 int res = packageName.compareTo(other.packageName); in compareTo()
|
/cts/tests/tests/packageinstaller/install/src/android/packageinstaller/install/cts/ |
D | ExternalSourcesTest.kt | 48 private val packageName = context.packageName constant 52 AppOpsUtils.setOpMode(packageName, APP_OP_STR, mode) in setAppOpsMode() 72 assertFalse("Package $packageName allowed to install packages after setting app op to " + in blockedSourceTest() 78 assertTrue("Operation not logged", AppOpsUtils.rejectedOperationLogged(packageName, in blockedSourceTest() 94 assertTrue("Package $packageName blocked from installing packages after setting app op " + in allowedSourceTest() 100 assertTrue("Operation not logged", AppOpsUtils.allowedOperationLogged(packageName, in allowedSourceTest() 115 assertFalse("Package $packageName with default app ops state allowed to install packages", in defaultSourceTest() 121 assertTrue("Operation not logged", AppOpsUtils.rejectedOperationLogged(packageName, in defaultSourceTest() 138 assertFalse("Package $packageName allowed to install packages after setting app op to " + in blockedSourceTest() 145 assertTrue("Package $packageName blocked from installing packages after setting app op " + in allowedSourceTest() [all …]
|
D | ExternalSourcesInstantAppsTest.kt | 36 private val packageName = InstrumentationRegistry.getTargetContext().packageName constant 39 AppOpsUtils.setOpMode(packageName, "REQUEST_INSTALL_PACKAGES", mode) in setAppOpsMode() 45 assertFalse("Instant app $packageName allowed to install packages", in blockedSourceTest() 52 assertFalse("Instant app $packageName allowed to install packages", in allowedSourceTest() 59 assertFalse("Instant app $packageName allowed to install packages", in defaultSourceTest()
|
/cts/hostsidetests/net/src/com/android/cts/net/ |
D | HostsideNetworkTestCase.java | 85 protected void uninstallPackage(String packageName, boolean shouldSucceed) in uninstallPackage() argument 87 final String result = getDevice().uninstallPackage(packageName); in uninstallPackage() 89 assertNull("uninstallPackage(" + packageName + ") failed: " + result, result); in uninstallPackage() 93 protected void assertPackageUninstalled(String packageName) throws DeviceNotAvailableException, in assertPackageUninstalled() argument 95 final String command = "cmd package list packages " + packageName; in assertPackageUninstalled() 107 if (line.endsWith(packageName)) { in assertPackageUninstalled() 116 Log.v(TAG, "Package " + packageName + " not uninstalled yet (" + result in assertPackageUninstalled() 120 fail("Package '" + packageName + "' not uinstalled after " + max_tries + " seconds"); in assertPackageUninstalled() 123 protected void runDeviceTests(String packageName, String testClassName) in runDeviceTests() argument 125 runDeviceTests(packageName, testClassName, null); in runDeviceTests() [all …]
|
/cts/hostsidetests/backup/src/android/cts/backup/ |
D | BaseMultiUserBackupHostSideTest.java | 159 void clearBackupDataInTransportForUser(String packageName, String transport, int userId) in clearBackupDataInTransportForUser() argument 162 String.format("bmgr --user %d wipe %s %s", userId, transport, packageName)); in clearBackupDataInTransportForUser() 166 void clearPackageDataAsUser(String packageName, int userId) throws DeviceNotAvailableException { in clearPackageDataAsUser() argument 167 mDevice.executeShellCommand(String.format("pm clear --user %d %s", userId, packageName)); in clearPackageDataAsUser() 177 void uninstallPackageAsUser(String packageName, int userId) throws DeviceNotAvailableException { in uninstallPackageAsUser() argument 179 String.format("pm uninstall --user %d %s", userId, packageName)); in uninstallPackageAsUser() 186 void installExistingPackageAsUser(String packageName, int userId) in installExistingPackageAsUser() argument 189 String.format("pm install-existing --user %d %s", userId, packageName)); in installExistingPackageAsUser() 197 void installExistingPackageAsUserWaitTillComplete(String packageName, int userId) in installExistingPackageAsUserWaitTillComplete() argument 200 String.format("pm install-existing --user %d --wait %s", userId, packageName)); in installExistingPackageAsUserWaitTillComplete() [all …]
|
D | BaseBackupHostSideTest.java | 106 protected void checkDeviceTest(String packageName, String className, String testName) in checkDeviceTest() argument 108 boolean result = runDeviceTests(packageName, className, testName); in checkDeviceTest() 112 protected void startActivityInPackageAndWait(String packageName, String className) in startActivityInPackageAndWait() argument 115 "am start -W -a android.intent.action.MAIN -n %s/%s.%s", packageName, in startActivityInPackageAndWait() 116 packageName, in startActivityInPackageAndWait() 125 protected void clearBackupDataInLocalTransport(String packageName) in clearBackupDataInLocalTransport() argument 128 String.format("bmgr wipe %s %s", LOCAL_TRANSPORT, packageName)); in clearBackupDataInLocalTransport() 134 protected void clearPackageData(String packageName) throws DeviceNotAvailableException { in clearPackageData() argument 135 getDevice().executeShellCommand(String.format("pm clear %s", packageName)); in clearPackageData()
|
/cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ |
D | Utils.java | 40 public static void runDeviceTestsAsCurrentUser(ITestDevice device, String packageName, in runDeviceTestsAsCurrentUser() argument 42 runDeviceTests(device, packageName, testClassName, testMethodName, device.getCurrentUser(), in runDeviceTestsAsCurrentUser() 46 public static void runDeviceTestsAsCurrentUser(ITestDevice device, String packageName, in runDeviceTestsAsCurrentUser() argument 49 runDeviceTests(device, packageName, testClassName, testMethodName, device.getCurrentUser(), in runDeviceTestsAsCurrentUser() 53 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 55 runDeviceTests(device, packageName, testClassName, testMethodName, USER_SYSTEM, null); in runDeviceTests() 58 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 61 runDeviceTests(device, packageName, testClassName, testMethodName, USER_SYSTEM, testArgs); in runDeviceTests() 64 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 66 runDeviceTests(device, packageName, testClassName, testMethodName, userId, null); in runDeviceTests() [all …]
|
/cts/tests/tests/permission2/src/android/permission2/cts/ |
D | PrivappPermissionsTest.java | 100 installedPackages.sort(Comparator.comparing(p -> p.packageName)); in privappPermissionsNeedToBeWhitelisted() 105 String packageName = pkg.packageName; in privappPermissionsNeedToBeWhitelisted() local 107 || PLATFORM_PACKAGE_NAME.equals(packageName)) { in privappPermissionsNeedToBeWhitelisted() 112 .getPackageInfo(packageName, MATCH_FACTORY_ONLY | GET_PERMISSIONS in privappPermissionsNeedToBeWhitelisted() 115 assertNotNull("No system image version found for " + packageName, factoryPkg); in privappPermissionsNeedToBeWhitelisted() 151 Set<String> whitelist = getPrivAppPermissions(packageName); in privappPermissionsNeedToBeWhitelisted() 152 Set<String> denylist = getPrivAppDenyPermissions(packageName); in privappPermissionsNeedToBeWhitelisted() 153 String msg = "Application " + packageName + "\n" in privappPermissionsNeedToBeWhitelisted() 179 packagesGrantedNotInWhitelist.put(packageName, grantedNotInWhitelist); in privappPermissionsNeedToBeWhitelisted() 183 packagesNotGrantedNotRemovedNotInDenylist.put(packageName, in privappPermissionsNeedToBeWhitelisted() [all …]
|
/cts/hostsidetests/net/app/src/com/android/cts/net/hostside/ |
D | MyVpnService.java | 47 String packageName = getPackageName(); in onStartCommand() local 48 String cmd = intent.getStringExtra(packageName + ".cmd"); in onStartCommand() 52 start(packageName, intent); in onStartCommand() 58 private void start(String packageName, Intent intent) { in start() argument 61 String addresses = intent.getStringExtra(packageName + ".addresses"); in start() 77 String routes = intent.getStringExtra(packageName + ".routes"); in start() 93 String allowed = intent.getStringExtra(packageName + ".allowedapplications"); in start() 108 String disallowed = intent.getStringExtra(packageName + ".disallowedapplications"); in start() 124 intent.getParcelableArrayListExtra(packageName + ".underlyingNetworks"); in start() 132 boolean isAlwaysMetered = intent.getBooleanExtra(packageName + ".isAlwaysMetered", false); in start() [all …]
|
/cts/hostsidetests/classloaders/useslibrary/src/android/classloaders/cts/ |
D | Utils.java | 35 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 37 runDeviceTests(device, packageName, testClassName, testMethodName, USER_SYSTEM, null); in runDeviceTests() 40 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 43 runDeviceTests(device, packageName, testClassName, testMethodName, USER_SYSTEM, testArgs); in runDeviceTests() 46 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 48 runDeviceTests(device, packageName, testClassName, testMethodName, userId, null); in runDeviceTests() 51 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 55 runDeviceTests(device, packageName, testClassName, testMethodName, userId, testArgs, in runDeviceTests() 59 public static void runDeviceTests(ITestDevice device, String packageName, String testClassName, in runDeviceTests() argument 64 testClassName = packageName + testClassName; in runDeviceTests() [all …]
|
/cts/tests/tests/content/src/android/content/om/cts/ |
D | OverlayManagerTest.java | 60 String packageName = "overlay source package name"; in testSetEnabled() local 63 verify(mMockService, times(0)).setEnabled(packageName, true, userId); in testSetEnabled() 66 mManager.setEnabled(packageName, true, user); in testSetEnabled() 67 verify(mMockService, times(1)).setEnabled(packageName, true, userId); in testSetEnabled() 72 String packageName = "overlay source package name"; in testSetEnabledExclusiveInCategory() local 75 verify(mMockService, times(0)).setEnabledExclusiveInCategory(packageName, userId); in testSetEnabledExclusiveInCategory() 78 mManager.setEnabledExclusiveInCategory(packageName, user); in testSetEnabledExclusiveInCategory() 79 verify(mMockService, times(1)).setEnabledExclusiveInCategory(packageName, userId); in testSetEnabledExclusiveInCategory()
|
/cts/hostsidetests/devicepolicy/app/LauncherTestsSupport/src/com/android/cts/launchertests/support/ |
D | LauncherCallbackTestsService.java | 173 String packageName = params.getString(PACKAGE_EXTRA); in eventExists() local 174 Log.i(TAG, "checking for " + packageName + " " + user); in eventExists() 178 if (event.first.equals(packageName) && event.second.equals(user)) { in eventExists() 179 Log.i(TAG, "Event exists " + packageName + " for user " + user); in eventExists() 196 public void onPackageRemoved(String packageName, UserHandle user) { in onPackageRemoved() argument 197 Log.i(TAG, "package removed event " + packageName + " " + user); in onPackageRemoved() 199 mPackagesRemoved.put(new Pair(packageName, user)); in onPackageRemoved() 205 public void onPackageAdded(String packageName, UserHandle user) { in onPackageAdded() argument 206 Log.i(TAG, "package added event " + packageName + " " + user); in onPackageAdded() 208 mPackagesAdded.put(new Pair(packageName, user)); in onPackageAdded() [all …]
|
/cts/tests/tests/accounts/src/android/accounts/cts/ |
D | AuthenticatorDescriptionTest.java | 10 private String packageName = "com.android.my.app"; field in AuthenticatorDescriptionTest 15 desc = new AuthenticatorDescription(accountType, packageName, 1, 1, 1, 1, true); in setUp() 20 new AuthenticatorDescription(null, packageName, 1, 1, 1, 1); in testObjectCreationWithNullAccountType() 35 new AuthenticatorDescription(accountType, packageName, -1, 0, -1, 1); in testObjectCreation() 36 new AuthenticatorDescription(accountType, packageName, -1, 0, -1, 1, true); in testObjectCreation()
|
/cts/libs/rollback/src/com/android/cts/rollback/lib/ |
D | Utils.java | 47 public static long getInstalledVersion(String packageName) { in getInstalledVersion() argument 51 PackageInfo info = pm.getPackageInfo(packageName, PackageManager.MATCH_APEX); in getInstalledVersion() 75 private static RollbackInfo getRollback(List<RollbackInfo> rollbacks, String packageName) { in getRollback() argument 79 if (packageName.equals(info.getPackageName())) { in getRollback() 108 public static RollbackInfo getAvailableRollback(String packageName) { in getAvailableRollback() argument 110 return getRollback(rm.getAvailableRollbacks(), packageName); in getAvailableRollback() 118 public static RollbackInfo getCommittedRollback(String packageName) { in getCommittedRollback() argument 120 return getRollback(rm.getRecentlyCommittedRollbacks(), packageName); in getCommittedRollback() 137 public static void uninstall(String packageName) throws InterruptedException, IOException { in uninstall() argument 139 if (getInstalledVersion(packageName) == -1) { in uninstall() [all …]
|
/cts/hostsidetests/inputmethodservice/common/src/android/inputmethodservice/cts/common/ |
D | ComponentNameUtils.java | 34 static String buildComponentName(String packageName, String className) { in buildComponentName() argument 35 return packageName + "/" + (className.startsWith(packageName) in buildComponentName() 36 ? className.substring(packageName.length()) : className); in buildComponentName()
|