Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 765f97d5 authored by Christopher Tate's avatar Christopher Tate
Browse files

Make sure to go to the right Settings panel when tapping a notification

We now use Intent.makeRestartActivityTask() to build the notification
PendingIntent objects, so that when tapped they restart the activity
in the desired state.

Fixes bug 5011926

Change-Id: Ie1ec3543cc0f49d1bd407622a617316cf53a078c
parent 5b56f7d6
Loading
Loading
Loading
Loading
+6 −12
Original line number Diff line number Diff line
@@ -568,11 +568,8 @@ public class UsbDeviceManager {
                    notification.sound = null;
                    notification.vibrate = null;

                    Intent intent = new Intent(
                            Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
                            Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                    intent.setComponent(new ComponentName("com.android.settings",
                    Intent intent = Intent.makeRestartActivityTask(
                            new ComponentName("com.android.settings",
                                    "com.android.settings.UsbSettings"));
                    PendingIntent pi = PendingIntent.getActivity(mContext, 0,
                            intent, 0);
@@ -604,11 +601,8 @@ public class UsbDeviceManager {
                    notification.sound = null;
                    notification.vibrate = null;

                    Intent intent = new Intent(
                            Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
                            Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                    intent.setComponent(new ComponentName("com.android.settings",
                    Intent intent = Intent.makeRestartActivityTask(
                            new ComponentName("com.android.settings",
                                    "com.android.settings.DevelopmentSettings"));
                    PendingIntent pi = PendingIntent.getActivity(mContext, 0,
                            intent, 0);