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

Commit b6ac55ff authored by Michael W's avatar Michael W
Browse files

DeskClock: Set FLAG_ACTIVITY_NEW_TASK explicitly

* From PendingIntent#getActivity() documentation:
  "Note that the activity will be started outside of the context of
  an existing activity, so you must use the
  Intent.FLAG_ACTIVITY_NEW_TASK launch flag in the Intent."
* Removes the warning
  ActivityTaskManager: startActivity called from non-Activity context;
  forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent {flg=0x800000
  cmp=com.android.deskclock/.timer.* }

Change-Id: I628a5b7fa9e8b00adca3d384dc0a12cb07b8efa8
parent f713c8b9
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -219,7 +219,9 @@ public class Utils {
     * @return a PendingIntent that will start an activity
     * @return a PendingIntent that will start an activity
     */
     */
    public static PendingIntent pendingActivityIntent(Context context, Intent intent) {
    public static PendingIntent pendingActivityIntent(Context context, Intent intent) {
        return PendingIntent.getActivity(context, 0, intent, FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE);
        // explicitly set the flag here, as getActivity() documentation states we must do so
        return PendingIntent.getActivity(context, 0, intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
                FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE);
    }
    }


    /**
    /**