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

Commit 8b83dc17 authored by Anil Admal's avatar Anil Admal
Browse files

Reconfigure GNSS HAL NFW proxy app list on GNSS service crash

Fixes: 134729449
Test: 1. Killed GNSS service several times and verified that the
         GNSS HAL is reconfigured.
      2. Verified on reboot the GNSS service is configured correctly.

Change-Id: Ic8b40ef2a907deef07d01ecb190291035069264d
parent 4cd89f03
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -151,7 +151,6 @@ class GnssVisibilityControl {
    }

    private void handleInitialize() {
        disableNfwLocationAccess(); // Disable until config properties are loaded.
        listenForProxyAppsPackageUpdates();
    }

@@ -261,25 +260,21 @@ class GnssVisibilityControl {
        return false;
    }

    private void handleGpsEnabledChanged(boolean isEnabled) {
        if (DEBUG) Log.d(TAG, "handleGpsEnabledChanged, isEnabled: " + isEnabled);

        if (mIsGpsEnabled == isEnabled) {
            return;
    private void handleGpsEnabledChanged(boolean isGpsEnabled) {
        if (DEBUG) {
            Log.d(TAG, "handleGpsEnabledChanged, mIsGpsEnabled: " + mIsGpsEnabled
                    + ", isGpsEnabled: " + isGpsEnabled);
        }

        mIsGpsEnabled = isEnabled;
        // The proxy app list in the GNSS HAL needs to be configured if it restarts after
        // a crash. So, update HAL irrespective of the previous GPS enabled state.
        mIsGpsEnabled = isGpsEnabled;
        if (!mIsGpsEnabled) {
            disableNfwLocationAccess();
            return;
        }

        // When GNSS was disabled, we already set the proxy app list to empty in GNSS HAL.
        // Update only if the proxy app list is not empty.
        String[] locationPermissionEnabledProxyApps = getLocationPermissionEnabledProxyApps();
        if (locationPermissionEnabledProxyApps.length != 0) {
            setNfwLocationAccessProxyAppsInGnssHal(locationPermissionEnabledProxyApps);
        }
        setNfwLocationAccessProxyAppsInGnssHal(getLocationPermissionEnabledProxyApps());
    }

    private void disableNfwLocationAccess() {
+1 −1

File changed.

Contains only whitespace changes.