From 38389b6cf7bd2ef49d2bd20ff1bca8677596590e Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Sun, 30 Sep 2012 11:44:22 -0700 Subject: Route GPS notifications to all users. This takes the easy way around notifying the correct users about GPS state transitions by notifying ALL the users(!). I've also laid groundwork for proper multiuser support in LocationManager and did a tiny bit of cleanup in GpsNetInitiatedHandler while I was looking at notifications. Bug: 7213552 Change-Id: I2d6dc65c459e55d110ac0f5f79ae7a87ad638ede --- .../com/android/internal/location/GpsNetInitiatedHandler.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'location/java/com') diff --git a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java index 0adba06fe36b..57e2786213bb 100755 --- a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java +++ b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java @@ -26,6 +26,7 @@ import android.content.Intent; import android.location.LocationManager; import android.os.Bundle; import android.os.RemoteException; +import android.os.UserHandle; import android.util.Log; import com.android.internal.R; @@ -89,7 +90,6 @@ public class GpsNetInitiatedHandler { // configuration of notificaiton behavior private boolean mPlaySounds = false; - private boolean visible = true; private boolean mPopupImmediately = true; // Set to true if string from HAL is encoded as Hex, e.g., "3F0039" @@ -213,11 +213,8 @@ public class GpsNetInitiatedHandler { PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, intent, 0); mNiNotification.setLatestEventInfo(mContext, title, message, pi); - if (visible) { - notificationManager.notify(notif.notificationId, mNiNotification); - } else { - notificationManager.cancel(notif.notificationId); - } + notificationManager.notifyAsUser(null, notif.notificationId, mNiNotification, + UserHandle.ALL); } // Opens the notification dialog and waits for user input -- cgit v1.2.3-59-g8ed1b