DO NOT MERGE Don't crash if already unregistered am: 07c129cb1a am: 002f775293
Change-Id: If67a1eb94e6e998388db6749712ddd4109cfd509
This commit is contained in:
@@ -2954,10 +2954,10 @@ public class LocationManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void unregisterService() throws RemoteException {
|
protected void unregisterService() throws RemoteException {
|
||||||
Preconditions.checkState(mListenerTransport != null);
|
if (mListenerTransport != null) {
|
||||||
|
mService.unregisterGnssStatusCallback(mListenerTransport);
|
||||||
mService.unregisterGnssStatusCallback(mListenerTransport);
|
mListenerTransport = null;
|
||||||
mListenerTransport = null;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class GnssStatusListener extends IGnssStatusListener.Stub {
|
private class GnssStatusListener extends IGnssStatusListener.Stub {
|
||||||
@@ -3020,10 +3020,10 @@ public class LocationManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void unregisterService() throws RemoteException {
|
protected void unregisterService() throws RemoteException {
|
||||||
Preconditions.checkState(mListenerTransport != null);
|
if (mListenerTransport != null) {
|
||||||
|
mService.removeGnssMeasurementsListener(mListenerTransport);
|
||||||
mService.removeGnssMeasurementsListener(mListenerTransport);
|
mListenerTransport = null;
|
||||||
mListenerTransport = null;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -3073,10 +3073,10 @@ public class LocationManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void unregisterService() throws RemoteException {
|
protected void unregisterService() throws RemoteException {
|
||||||
Preconditions.checkState(mListenerTransport != null);
|
if (mListenerTransport != null) {
|
||||||
|
mService.removeGnssNavigationMessageListener(mListenerTransport);
|
||||||
mService.removeGnssNavigationMessageListener(mListenerTransport);
|
mListenerTransport = null;
|
||||||
mListenerTransport = null;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class GnssNavigationMessageListener extends IGnssNavigationMessageListener.Stub {
|
private class GnssNavigationMessageListener extends IGnssNavigationMessageListener.Stub {
|
||||||
@@ -3114,10 +3114,10 @@ public class LocationManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void unregisterService() throws RemoteException {
|
protected void unregisterService() throws RemoteException {
|
||||||
Preconditions.checkState(mListenerTransport != null);
|
if (mListenerTransport != null) {
|
||||||
|
mService.removeGnssAntennaInfoListener(mListenerTransport);
|
||||||
mService.removeGnssAntennaInfoListener(mListenerTransport);
|
mListenerTransport = null;
|
||||||
mListenerTransport = null;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class GnssAntennaInfoListener extends IGnssAntennaInfoListener.Stub {
|
private class GnssAntennaInfoListener extends IGnssAntennaInfoListener.Stub {
|
||||||
@@ -3151,10 +3151,10 @@ public class LocationManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void unregisterService() throws RemoteException {
|
protected void unregisterService() throws RemoteException {
|
||||||
Preconditions.checkState(mListenerTransport != null);
|
if (mListenerTransport != null) {
|
||||||
|
mService.removeGnssBatchingCallback();
|
||||||
mService.removeGnssBatchingCallback();
|
mListenerTransport = null;
|
||||||
mListenerTransport = null;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class BatchedLocationCallback extends IBatchedLocationCallback.Stub {
|
private class BatchedLocationCallback extends IBatchedLocationCallback.Stub {
|
||||||
|
|||||||
Reference in New Issue
Block a user