OSDN Git Service

DO NOT MERGE - SUPL ES Extension - Safer Init and Not After Boot
authorWyattRiley <wyattriley@google.com>
Tue, 19 Feb 2019 21:19:13 +0000 (13:19 -0800)
committerKevin F. Haggerty <haggertk@lineageos.org>
Sat, 18 May 2019 15:47:52 +0000 (09:47 -0600)
Safe order of pointer setting and background thread start
Verifying mCallEndElapsedRealtimeMillis is not the initial value

Bug: 112159033
Bug: 115361555
Bug: 125124724
Test: Verified not-after-boot with test code b/115361555#comment14
Test: Reproed NPE on Nexus 5x with test thread sleep and verify fix
Change-Id: I596f913bc79873274c2743132c93ef2381d9f3c7
(cherry picked from commit b5e7bbe5b8e1d120d3f13f6d15b7be16d4f2e132)

location/java/com/android/internal/location/GpsNetInitiatedHandler.java
services/core/java/com/android/server/location/GnssLocationProvider.java

index 93e86af..75f046b 100644 (file)
@@ -16,8 +16,6 @@
 
 package com.android.internal.location;
 
-import java.io.UnsupportedEncodingException;
-
 import android.app.Notification;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
@@ -25,20 +23,20 @@ import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.location.LocationManager;
 import android.location.INetInitiatedListener;
-import android.telephony.TelephonyManager;
-import android.telephony.PhoneNumberUtils;
-import android.telephony.PhoneStateListener;
+import android.location.LocationManager;
 import android.os.Bundle;
 import android.os.RemoteException;
-import android.os.UserHandle;
 import android.os.SystemProperties;
+import android.os.UserHandle;
+import android.telephony.PhoneNumberUtils;
+import android.telephony.PhoneStateListener;
+import android.telephony.TelephonyManager;
 import android.util.Log;
-
 import com.android.internal.R;
 import com.android.internal.telephony.GsmAlphabet;
 import com.android.internal.telephony.TelephonyProperties;
+import java.io.UnsupportedEncodingException;
 
 /**
  * A GPS Network-initiated Handler class used by LocationManager.
index 2228b3f..2c11a01 100644 (file)
@@ -748,12 +748,11 @@ public class GnssLocationProvider implements LocationProviderInterface {
         // while IO initialization and registration is delegated to our internal handler
         // this approach is just fine because events are posted to our handler anyway
         mProperties = new Properties();
-        sendMessage(INITIALIZE_HANDLER, 0, null);
-
-        // Create a GPS net-initiated handler.
+        // Create a GPS net-initiated handler (also needed by handleInitialize)
         mNIHandler = new GpsNetInitiatedHandler(context,
                                                 mNetInitiatedListener,
                                                 mSuplEsEnabled);
+        sendMessage(INITIALIZE_HANDLER, 0, null);
 
         mListenerHelper = new GnssStatusListenerHelper(mHandler) {
             @Override