From 8a246a2bce09dccccddd7c734f4f5d96ee57ea14 Mon Sep 17 00:00:00 2001 From: Anil Admal Date: Sun, 5 May 2019 00:34:55 -0700 Subject: User notification of NFW emergency requests similar to IGnssNi.hal Fixes: 130892418 Test: Manual Change-Id: Ie505f4c08ffbabfaba3a072c5e14cf8a732c6860 --- .../android/internal/location/GpsNetInitiatedHandler.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'location/java') diff --git a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java index b4be21987cf7..04e7bab0542b 100644 --- a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java +++ b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java @@ -357,8 +357,10 @@ public class GpsNetInitiatedHandler { } } - // Sets the NI notification. - private synchronized void setNiNotification(GpsNiNotification notif) { + /** + * Posts a notification in the status bar using the contents in {@code notif} object. + */ + public synchronized void setNiNotification(GpsNiNotification notif) { NotificationManager notificationManager = (NotificationManager) mContext .getSystemService(Context.NOTIFICATION_SERVICE); if (notificationManager == null) { @@ -539,14 +541,14 @@ public class GpsNetInitiatedHandler { */ static private String decodeString(String original, boolean isHex, int coding) { + if (coding == GPS_ENC_NONE) { + return original; + } + String decoded = original; byte[] input = stringToByteArray(original, isHex); switch (coding) { - case GPS_ENC_NONE: - decoded = original; - break; - case GPS_ENC_SUPL_GSM_DEFAULT: decoded = decodeGSMPackedString(input); break; -- cgit v1.2.3-59-g8ed1b