Emergency SUPL when location is disabled

A cycle of native_init() and native_cleanup() is needed so that
callbacks are registered after bootup even when location is disabled.
This will allow Emergency SUPL to work even when location is disabled
before device restart.

Merged-In: I423d5a7142709fc0579be009bb8b14d3778aa090

BUG:38362097

Change-Id: I423d5a7142709fc0579be009bb8b14d3778aa090
This commit is contained in:
Siddharth Ray
2017-06-21 15:14:44 -07:00
parent b792f98446
commit 9be64f128d

View File

@@ -778,6 +778,18 @@ public class GnssLocationProvider implements LocationProviderInterface {
return isEnabled();
}
};
/*
* A cycle of native_init() and native_cleanup() is needed so that callbacks are registered
* after bootup even when location is disabled. This will allow Emergency SUPL to work even
* when location is disabled before device restart.
* */
boolean isInitialized = native_init();
if(!isInitialized) {
Log.d(TAG, "Failed to initialize at bootup");
} else {
native_cleanup();
}
}
/**