We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3445df1 commit 3f8f5e4Copy full SHA for 3f8f5e4
Kill.apk
172 Bytes
sample/src/main/java/com/xdandroid/sample/misc/GenOpsActivity.java
@@ -17,16 +17,7 @@
17
public class GenOpsActivity extends Activity {
18
19
static String genOp(String pkg, String op) {
20
- String mode;
21
- switch (op) {
22
- case "RUN_IN_BACKGROUND":
23
- mode = WHITE_LIST_APPS.contains(pkg) ? "allow" : "ignore";
24
- break;
25
- default:
26
- mode = "ignore";
27
28
- }
29
- return "adb shell cmd appops set " + pkg + " " + op + " " + mode + "\n\n";
+ return "adb shell cmd appops set " + pkg + " " + op + " " + ("RUN_IN_BACKGROUND".equals(op) && WHITE_LIST_APPS.contains(pkg) ? "allow" : "ignore") + "\n\n";
30
}
31
32
@SuppressWarnings("unchecked")
0 commit comments