Home
last modified time | relevance | path

Searched refs:opStr (Results 1 – 5 of 5) sorted by relevance

/cts/common/device-side/util/src/com/android/compatibility/common/util/
DAppOpsUtils.java53 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()
125 private static String getOpState(String packageName, String opStr) throws IOException { in getOpState() argument
126 return runCommand("appops get " + packageName + " " + opStr); in getOpState()
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/
DAppOpsUtils.java54 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()
126 private static String getOpState(String packageName, String opStr) throws IOException { in getOpState() argument
127 return runCommand("appops get " + packageName + " " + opStr); in getOpState()
/cts/tests/tests/appop/src/android/app/appops/cts/
DAppOpsUtils.kt52 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()
122 private fun getOpState(packageName: String, opStr: String) : String { in getOpState()
123 return runCommand("appops get $packageName $opStr") in getOpState()
DAppOpsTest.kt296 for (opStr in AppOpsManager.getOpStrs()) { in testAllOpsHaveOpString() constant
297 assertNotNull("Each app op must have an operation string defined", opStr) in testAllOpsHaveOpString()
298 opStrs.add(opStr) in testAllOpsHaveOpString()
307 for (opStr in opStrs) { in testOpCodesUnique() constant
308 opCodes.add(AppOpsManager.strOpToOp(opStr)) in testOpCodesUnique()
320 private fun testPermissionMapping(permission: String, opStr: String) { in testPermissionMapping()
323 assertEquals(mappedOpStr, opStr) in testPermissionMapping()
325 val mappedOpCode2 = AppOpsManager.strOpToOp(opStr) in testPermissionMapping()
/cts/tests/app/src/android/app/cts/android/app/cts/tools/
DServiceProcessController.java157 public void setAppOpMode(String opStr, String mode) throws IOException { in setAppOpMode() argument
158 String cmd = "cmd appops set " + mServicePackage + " " + opStr + " " + mode; in setAppOpMode()