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

Commit 07c129cb authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

DO NOT MERGE Don't crash if already unregistered

Bug: 155284432
Test: manual
Change-Id: Id04ab9093b9cd4c837058442a8d0e04ff4dde051
parent ddb28a55
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -2954,11 +2954,11 @@ public class LocationManager {

        @Override
        protected void unregisterService() throws RemoteException {
            Preconditions.checkState(mListenerTransport != null);

            if (mListenerTransport != null) {
                mService.unregisterGnssStatusCallback(mListenerTransport);
                mListenerTransport = null;
            }
        }

        private class GnssStatusListener extends IGnssStatusListener.Stub {
            @Override
@@ -3020,11 +3020,11 @@ public class LocationManager {

        @Override
        protected void unregisterService() throws RemoteException {
            Preconditions.checkState(mListenerTransport != null);

            if (mListenerTransport != null) {
                mService.removeGnssMeasurementsListener(mListenerTransport);
                mListenerTransport = null;
            }
        }

        @Override
        @Nullable
@@ -3073,11 +3073,11 @@ public class LocationManager {

        @Override
        protected void unregisterService() throws RemoteException {
            Preconditions.checkState(mListenerTransport != null);

            if (mListenerTransport != null) {
                mService.removeGnssNavigationMessageListener(mListenerTransport);
                mListenerTransport = null;
            }
        }

        private class GnssNavigationMessageListener extends IGnssNavigationMessageListener.Stub {
            @Override
@@ -3114,11 +3114,11 @@ public class LocationManager {

        @Override
        protected void unregisterService() throws RemoteException {
            Preconditions.checkState(mListenerTransport != null);

            if (mListenerTransport != null) {
                mService.removeGnssAntennaInfoListener(mListenerTransport);
                mListenerTransport = null;
            }
        }

        private class GnssAntennaInfoListener extends IGnssAntennaInfoListener.Stub {
            @Override
@@ -3151,11 +3151,11 @@ public class LocationManager {

        @Override
        protected void unregisterService() throws RemoteException {
            Preconditions.checkState(mListenerTransport != null);

            if (mListenerTransport != null) {
                mService.removeGnssBatchingCallback();
                mListenerTransport = null;
            }
        }

        private class BatchedLocationCallback extends IBatchedLocationCallback.Stub {
            @Override