Provide an option to disable app blocking.
adb shell dumpsys activity service com.android.car enable-uxr
true|false
Running above command and setting it to false will disable UXR blocking.
Bug:72992174
Test: Running above command and setting it to false will allow any app to
run while in restricted mode. Setting it to true will enable back UX
Restriction behavior.
Change-Id: Ic66976dde6965b4a8e5395a70a142f12eb6bc9f3
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index a676fcc..34a6c60 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -404,6 +404,7 @@
private static final String COMMAND_HELP = "-h";
private static final String COMMAND_DAY_NIGHT_MODE = "day-night-mode";
private static final String COMMAND_INJECT_EVENT = "inject-event";
+ private static final String COMMAND_ENABLE_UXR = "enable-uxr";
private static final String PARAM_DAY_MODE = "day";
private static final String PARAM_NIGHT_MODE = "night";
@@ -417,8 +418,10 @@
pw.println("\t Print this help text.");
pw.println("\tday-night-mode [day|night|sensor]");
pw.println("\t Force into day/night mode or restore to auto.");
- pw.println("\tday-night-mode [day|night|sensor]");
- pw.println("\t Force into day/night mode or restore to auto.");
+ pw.println("\tinject-event zoned-boolean|global-integer property [zone] value");
+ pw.println("\t Inject a vehicle property - zoned boolean or global integer.");
+ pw.println("\tdisable-uxr true|false");
+ pw.println("\t Disable UX restrictions and App blocking.");
}
public void exec(String[] args, PrintWriter writer) {
@@ -461,6 +464,17 @@
}
}
break;
+ case COMMAND_ENABLE_UXR:
+ if (args.length < 2) {
+ writer.println("Incorrect number of arguments");
+ dumpHelp(writer);
+ break;
+ }
+ boolean enableBlocking = Boolean.valueOf(args[1]);
+ if (mCarPackageManagerService != null) {
+ mCarPackageManagerService.setEnableActivityBlocking(enableBlocking);
+ }
+ break;
default:
writer.println("Unknown command.");
dumpHelp(writer);