summaryrefslogtreecommitdiff
path: root/location
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-13 10:56:31 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-13 10:56:31 -0800
commitd3c246c403476e9782eb65744c115201cbf9b948 (patch)
tree2d16a9088447189c69eeb8a1280374b623f46faa /location
parentca384f867c73ed8192bbca982d0f4b4599f6c6ed (diff)
parent5dc21225c57c74985b741b1565eabafb75cdd2f3 (diff)
Merge "Adding nullptr check for some framework components" into main
Diffstat (limited to 'location')
-rw-r--r--location/java/android/location/Geocoder.java7
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) {