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.
BUG:38362097
Change-Id: I423d5a7142709fc0579be009bb8b14d3778aa090
diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java
index 4a45c07..2afed3c 100644
--- a/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -784,6 +784,18 @@
}
};
mGnssMetrics = new GnssMetrics();
+
+ /*
+ * 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();
+ }
}
/**