diff options
author | 2025-01-13 11:55:13 -0800 | |
---|---|---|
committer | 2025-01-13 11:55:13 -0800 | |
commit | 1fb61a849732506840b2f08c97329f7e9082ab04 (patch) | |
tree | 872754990366100401f7c82be50b5178e2e921a7 /location | |
parent | 4a1de76268fc06d54747f11647eb600914bb1c17 (diff) | |
parent | c063a0e71b34f0ac06b5c683a78082631fc206ba (diff) |
Merge "Adding nullptr check for some framework components" into main am: d3c246c403 am: c063a0e71b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3349287
Change-Id: I54bf5132e157caa0421f3ec300d80ee92dea04a2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'location')
-rw-r--r-- | location/java/android/location/Geocoder.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/location/java/android/location/Geocoder.java b/location/java/android/location/Geocoder.java index cdde7c66e268..9746dab4151c 100644 --- a/location/java/android/location/Geocoder.java +++ b/location/java/android/location/Geocoder.java @@ -83,8 +83,11 @@ public final class Geocoder { * succeed. */ public static boolean isPresent() { - ILocationManager lm = Objects.requireNonNull(ILocationManager.Stub.asInterface( - ServiceManager.getService(Context.LOCATION_SERVICE))); + ILocationManager lm = ILocationManager.Stub.asInterface( + ServiceManager.getService(Context.LOCATION_SERVICE)); + if (lm == null) { + return false; + } try { return lm.isGeocodeAvailable(); } catch (RemoteException e) { |