From 1da6f0eb4965031591448eda35820557610f07da Mon Sep 17 00:00:00 2001 From: Grace Cheng Date: Wed, 14 Jul 2021 15:29:50 -0700 Subject: [PATCH] Makes injectLocation a system api to suport car stack mainline updatability. The detailed reason why we do this is explained in the bug. Bug: 192377485 Test: build Change-Id: If5a800257cd3a875de208f8142ef5b4e88a05dbe --- core/api/module-lib-current.txt | 8 ++++++++ location/java/android/location/LocationManager.java | 1 + 2 files changed, 9 insertions(+) diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index b22a83dc289d3..ef9df6609bb93 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -102,6 +102,14 @@ package android.hardware.usb { } +package android.location { + + public class LocationManager { + method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.ACCESS_FINE_LOCATION}) public boolean injectLocation(@NonNull android.location.Location); + } + +} + package android.media { public class AudioManager { diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java index 526b84e85e383..ccd979c095ce3 100644 --- a/location/java/android/location/LocationManager.java +++ b/location/java/android/location/LocationManager.java @@ -1569,6 +1569,7 @@ public class LocationManager { * * @hide */ + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(allOf = {LOCATION_HARDWARE, ACCESS_FINE_LOCATION}) public boolean injectLocation(@NonNull Location location) { Preconditions.checkArgument(location != null, "invalid null location");