Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c25790f8 authored by Abhishek Gadewar's avatar Abhishek Gadewar
Browse files

Avoid NullPointerException if Location manager is disabled



Test: Build pass

Change-Id: Id91b443a95f6910ac26b2a829d5f4f06790beb8e
Signed-off-by: default avatarAbhishek Gadewar <abhishekgadewar@meta.com>
parent e4f54266
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat

        final LocationManagerInternal locationManagerInternal = LocalServices.getService(
                LocationManagerInternal.class);
        if (locationManagerInternal != null) {
            locationManagerInternal.setLocationPackageTagsListener(
                (uid, packageTagsList) -> {
                    synchronized (mLock) {
@@ -158,6 +159,7 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
                                mLocationTags);
                    }
                });
        }

        final IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);