DO NOT MERGE: Call handleInitialize() in the end of constructor
- Avoid race condition when variables are not initialized but the handler thread tries to use them. Bug: 159504970 Test: on device Change-Id: Id26e2d804e91c7dc013fb6783c8d923e6319af15
This commit is contained in:
@@ -678,8 +678,6 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
|
|||||||
mNetworkConnectivityHandler = new GnssNetworkConnectivityHandler(context,
|
mNetworkConnectivityHandler = new GnssNetworkConnectivityHandler(context,
|
||||||
GnssLocationProvider.this::onNetworkAvailable, mLooper, mNIHandler);
|
GnssLocationProvider.this::onNetworkAvailable, mLooper, mNIHandler);
|
||||||
|
|
||||||
sendMessage(INITIALIZE_HANDLER, 0, null);
|
|
||||||
|
|
||||||
mGnssStatusListenerHelper = new GnssStatusListenerHelper(mContext, mHandler) {
|
mGnssStatusListenerHelper = new GnssStatusListenerHelper(mContext, mHandler) {
|
||||||
@Override
|
@Override
|
||||||
protected boolean isAvailableInPlatform() {
|
protected boolean isAvailableInPlatform() {
|
||||||
@@ -746,6 +744,8 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
|
|||||||
|
|
||||||
setProperties(PROPERTIES);
|
setProperties(PROPERTIES);
|
||||||
setAllowed(true);
|
setAllowed(true);
|
||||||
|
|
||||||
|
sendMessage(INITIALIZE_HANDLER, 0, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user