Fix bug in error checking in GnssLocationProvider
Needed to check if gnssNiIface was a nullptr before calling setCallback on it. Bug: 36052760 Test: make Change-Id: I4d725bd30310353fb7d248f9bf247ac55f94c765
This commit is contained in:
@@ -1175,7 +1175,7 @@ static jboolean android_location_GnssLocationProvider_init(JNIEnv* env, jobject
|
||||
}
|
||||
|
||||
sp<IGnssNiCallback> gnssNiCbIface = new GnssNiCallback();
|
||||
if (gnssNiCbIface != nullptr) {
|
||||
if (gnssNiIface != nullptr) {
|
||||
gnssNiIface->setCallback(gnssNiCbIface);
|
||||
} else {
|
||||
ALOGE("Unable to initialize GNSS NI interface\n");
|
||||
|
||||
Reference in New Issue
Block a user