reduce number of location query
1. remove query Country Code to prevent HW and AK gets satellute supported state
2. adopb 24hr location result cache to return when it is not emergency case.
3. Add an internal interface to set/clear 24Hr cache as CTS on CF can't
do the location query
Bug: 340331500
Test: atest AccessControllerTest SatelliteManagerTest
SatelliteManagerTestOnMockService
manually test using fake emergency call
Change-Id: I88c495ead4f12b3cf7c8a5b4f1752ef0912698e9
diff --git a/src/com/android/phone/TelephonyShellCommand.java b/src/com/android/phone/TelephonyShellCommand.java
index 23232ce..2ae8d28 100644
--- a/src/com/android/phone/TelephonyShellCommand.java
+++ b/src/com/android/phone/TelephonyShellCommand.java
@@ -207,6 +207,8 @@
"set-oem-enabled-satellite-provision-status";
private static final String SET_SHOULD_SEND_DATAGRAM_TO_MODEM_IN_DEMO_MODE =
"set-should-send-datagram-to-modem-in-demo-mode";
+ private static final String SET_IS_SATELLITE_COMMUNICATION_ALLOWED_FOR_CURRENT_LOCATION_CACHE =
+ "set-is-satellite-communication-allowed-for-current-location-cache";
private static final String DOMAIN_SELECTION_SUBCOMMAND = "domainselection";
private static final String DOMAIN_SELECTION_SET_SERVICE_OVERRIDE = "set-dss-override";
@@ -418,6 +420,8 @@
return handleSetCountryCodes();
case SET_OEM_ENABLED_SATELLITE_PROVISION_STATUS:
return handleSetOemEnabledSatelliteProvisionStatus();
+ case SET_IS_SATELLITE_COMMUNICATION_ALLOWED_FOR_CURRENT_LOCATION_CACHE:
+ return handleSetIsSatelliteCommunicationAllowedForCurrentLocationCache();
default: {
return handleDefaultCommands(cmd);
}
@@ -3699,6 +3703,61 @@
return 0;
}
+ private int handleSetIsSatelliteCommunicationAllowedForCurrentLocationCache() {
+ PrintWriter errPw = getErrPrintWriter();
+ String opt;
+ String state;
+
+ if ((opt = getNextArg()) == null) {
+ errPw.println(
+ "adb shell cmd phone set-is-satellite-communication-allowed-for-current"
+ + "-location-cache :"
+ + " Invalid Argument");
+ return -1;
+ } else {
+ switch (opt) {
+ case "-a": {
+ state = "cache_allowed";
+ break;
+ }
+ case "-n": {
+ state = "cache_clear_and_not_allowed";
+ break;
+ }
+ case "-c": {
+ state = "clear_cache_only";
+ break;
+ }
+ default:
+ errPw.println(
+ "adb shell cmd phone set-is-satellite-communication-allowed-for-current"
+ + "-location-cache :"
+ + " Invalid Argument");
+ return -1;
+ }
+ }
+
+ Log.d(LOG_TAG, "handleSetIsSatelliteCommunicationAllowedForCurrentLocationCache("
+ + state + ")");
+
+ try {
+ boolean result = mInterface.setIsSatelliteCommunicationAllowedForCurrentLocationCache(
+ state);
+ if (VDBG) {
+ Log.v(LOG_TAG, "setIsSatelliteCommunicationAllowedForCurrentLocationCache "
+ + "returns: "
+ + result);
+ }
+ getOutPrintWriter().println(result);
+ } catch (RemoteException e) {
+ Log.w(LOG_TAG, "setIsSatelliteCommunicationAllowedForCurrentLocationCache("
+ + state + "), error = " + e.getMessage());
+ errPw.println("Exception: " + e.getMessage());
+ return -1;
+ }
+ return 0;
+ }
+
/**
* Sample inputStr = "US,UK,CA;2,1,3"
* Sample output: {[US,2], [UK,1], [CA,3]}