Allow OEMs to configure tethered AP for projection
Currently the flag that indicates whether Access Point should use
tethering was hard-coded in java code, this CL allows OEMs to set this
flag. Also, tethered access point will use the same Wi-Fi configuration
that available in Settings app.
Bug:133166243
Test: m -j ; # verify existing functionality works with local-only AP
Test: adb shell dumpsys activity service com.android.car
projection-tethering true ; # verify that now AP tethered
Change-Id: If0cd8e17f14f31b55109e36b78426d8e675710b9
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index 0335186..cbd0b8b 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -511,6 +511,7 @@
private static final String COMMAND_GET_DO_ACTIVITIES = "get-do-activities";
private static final String COMMAND_GET_CARPROPERTYCONFIG = "get-carpropertyconfig";
private static final String COMMAND_GET_PROPERTY_VALUE = "get-property-value";
+ private static final String COMMAND_PROJECTION_AP_TETHERING = "projection-tethering";
private static final String COMMAND_PROJECTION_UI_MODE = "projection-ui-mode";
private static final String COMMAND_RESUME = "resume";
private static final String COMMAND_SUSPEND = "suspend";
@@ -555,6 +556,9 @@
pw.println("\t Enable/Disable Trusted device feature.");
pw.println("\tremove-trusted-devices");
pw.println("\t Remove all trusted devices for the current foreground user.");
+ pw.println("\tprojection-tethering [true|false]");
+ pw.println("\t Whether tethering should be used when creating access point for"
+ + " wireless projection");
}
public void exec(String[] args, PrintWriter writer) {
@@ -649,6 +653,14 @@
}
mCarProjectionService.setUiMode(Integer.valueOf(args[1]));
break;
+ case COMMAND_PROJECTION_AP_TETHERING:
+ if (args.length != 2) {
+ writer.println("Incorrect number of arguments");
+ dumpHelp(writer);
+ break;
+ }
+ mCarProjectionService.setAccessPointTethering(Boolean.valueOf(args[1]));
+ break;
case COMMAND_RESUME:
mCarPowerManagementService.forceSimulatedResume();
writer.println("Resume: Simulating resuming from Deep Sleep");