summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-04-07 23:48:32 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-04-07 23:48:32 +0000
commitfa45c06a62e071c78bc35d8915fbff756ec8dbca (patch)
tree59b815787024edcce813d0f0cd69507640029580
parentc28356b9c6e8e057ebe8932e5bc0e9be02094b91 (diff)
parent4661b74d37cca23575a52b4f2561966ac66e88b1 (diff)
Merge "Extend support for requestRouteToHostAddress for backward compatibility"
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index b786018324d5..9d2965afdbca 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -133,6 +133,7 @@ import android.os.ServiceSpecificException;
import android.os.ShellCallback;
import android.os.ShellCommand;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -1628,8 +1629,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
*/
private boolean disallowedBecauseSystemCaller() {
// TODO: start throwing a SecurityException when GnssLocationProvider stops calling
- // requestRouteToHost.
- if (isSystem(Binder.getCallingUid())) {
+ // requestRouteToHost. In Q, GnssLocationProvider is changed to not call requestRouteToHost
+ // for devices launched with Q and above. However, existing devices upgrading to Q and
+ // above must continued to be supported for few more releases.
+ if (isSystem(Binder.getCallingUid()) && SystemProperties.getInt(
+ "ro.product.first_api_level", 0) > Build.VERSION_CODES.P) {
log("This method exists only for app backwards compatibility"
+ " and must not be called by system services.");
return true;