diff options
| author | 2018-12-21 14:59:36 -0800 | |
|---|---|---|
| committer | 2019-01-09 12:16:31 -0800 | |
| commit | d71cf1499b4def9ccb27a5224ba752a8dbba0e98 (patch) | |
| tree | c0a82a9281ec04fc8941d590206426ca014d71e9 /location/java | |
| parent | f2497e52b1c5951fcd557e225a5f35f25f0632f3 (diff) | |
Add emergency session extension duration (framework)
Add new method in IGnssConfiguration.hal to pass emergency
session extension duration to GNSS HAL implemenation so that
network initiated emergency location requests can be served
for this extra duration post emergency call.
Bug: 121204694
Test: GNSS HAL implementation not ready. So, tested with code
instrumentation that this configuration parameter is
called only for GNSS HAL 2.0 implementation.
Change-Id: I845cc13412d9027b7924bfcffecbf6438f2e4be7
Diffstat (limited to 'location/java')
| -rw-r--r-- | location/java/com/android/internal/location/GpsNetInitiatedHandler.java | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java index b5313256e4dc..866634e17513 100644 --- a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java +++ b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java @@ -16,9 +16,6 @@ package com.android.internal.location; -import java.io.UnsupportedEncodingException; -import java.util.concurrent.TimeUnit; - import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; @@ -26,20 +23,23 @@ 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.location.LocationManager; +import android.os.RemoteException; import android.os.SystemClock; -import android.telephony.TelephonyManager; +import android.os.UserHandle; import android.telephony.PhoneNumberUtils; import android.telephony.PhoneStateListener; -import android.os.RemoteException; -import android.os.UserHandle; +import android.telephony.TelephonyManager; import android.util.Log; -import com.android.internal.notification.SystemNotificationChannels; import com.android.internal.R; +import com.android.internal.notification.SystemNotificationChannels; import com.android.internal.telephony.GsmAlphabet; +import java.io.UnsupportedEncodingException; +import java.util.concurrent.TimeUnit; + /** * A GPS Network-initiated Handler class used by LocationManager. * @@ -92,9 +92,6 @@ public class GpsNetInitiatedHandler { public static final int GPS_ENC_SUPL_UCS2 = 3; public static final int GPS_ENC_UNKNOWN = -1; - // Limit on SUPL NI emergency mode time extension after emergency sessions ends - private static final int MAX_EMERGENCY_MODE_EXTENSION_SECONDS = 300; // 5 minute maximum - private final Context mContext; private final TelephonyManager mTelephonyManager; private final PhoneStateListener mPhoneStateListener; @@ -252,19 +249,9 @@ public class GpsNetInitiatedHandler { } public void setEmergencyExtensionSeconds(int emergencyExtensionSeconds) { - if (emergencyExtensionSeconds > MAX_EMERGENCY_MODE_EXTENSION_SECONDS) { - Log.w(TAG, "emergencyExtensionSeconds " + emergencyExtensionSeconds - + " too high, reset to " + MAX_EMERGENCY_MODE_EXTENSION_SECONDS); - emergencyExtensionSeconds = MAX_EMERGENCY_MODE_EXTENSION_SECONDS; - } else if (emergencyExtensionSeconds < 0) { - Log.w(TAG, "emergencyExtensionSeconds " + emergencyExtensionSeconds - + " is negative, reset to zero."); - emergencyExtensionSeconds = 0; - } mEmergencyExtensionMillis = TimeUnit.SECONDS.toMillis(emergencyExtensionSeconds); } - // Handles NI events from HAL public void handleNiNotification(GpsNiNotification notif) { if (DEBUG) Log.d(TAG, "in handleNiNotification () :" |