From e5e764ad0bb74d8c1405d018b4e0fe92d6554660 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 3 Feb 2011 23:55:59 -0800 Subject: [PATCH] Open the location settings when clicking the GPS notification. Change-Id: I4203d75b7d18ab61f1f8e77452440bdc47161a10 --- .../systemui/statusbar/policy/LocationController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java index 76c05d2a16b82..bb326fef461f1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationController.java @@ -20,11 +20,13 @@ import java.util.ArrayList; import android.app.Notification; import android.app.NotificationManager; +import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.location.LocationManager; +import android.provider.Settings; import android.util.Slog; import android.view.View; import android.widget.ImageView; @@ -83,10 +85,15 @@ public class LocationController extends BroadcastReceiver { try { if (visible) { + Intent gpsIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); + gpsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, gpsIntent, 0); + Notification n = new Notification.Builder(mContext) .setSmallIcon(iconId) .setContentTitle(mContext.getText(textResId)) .setOngoing(true) + .setContentIntent(pendingIntent) .getNotification(); // Notification.Builder will helpfully fill these out for you no matter what you do