Missed call notification creates PendingIntent using TaskStackBuilder

Bug: 10262590
Change-Id: Iedc11dfbd40c167a2eefc8f32ebb1dc322e36ef0
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 7cda28c..922b387 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -44,7 +44,6 @@
 import android.telephony.ServiceState;
 import android.text.TextUtils;
 import android.util.Log;
-import android.widget.ImageView;
 import android.widget.Toast;
 
 import com.android.internal.telephony.Call;
@@ -484,7 +483,8 @@
             String name, String number, String type, Drawable photo, Bitmap photoIcon, long date) {
 
         // When the user clicks this notification, we go to the call log.
-        final Intent callLogIntent = PhoneGlobals.createCallLogIntent();
+        final PendingIntent pendingCallLogIntent = PhoneGlobals.createPendingCallLogIntent(
+                mContext);
 
         // Never display the missed call notification on non-voice-capable
         // devices, even if the device does somehow manage to get an
@@ -537,7 +537,7 @@
                 .setWhen(date)
                 .setContentTitle(mContext.getText(titleResId))
                 .setContentText(expandedText)
-                .setContentIntent(PendingIntent.getActivity(mContext, 0, callLogIntent, 0))
+                .setContentIntent(pendingCallLogIntent)
                 .setAutoCancel(true)
                 .setDeleteIntent(createClearMissedCallsIntent());
 
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index 42f7f8c..dc7d64b 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -20,6 +20,7 @@
 import android.app.KeyguardManager;
 import android.app.PendingIntent;
 import android.app.ProgressDialog;
+import android.app.TaskStackBuilder;
 import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.IBluetoothHeadsetPhone;
 import android.content.ActivityNotFoundException;
@@ -690,6 +691,13 @@
         return intent;
     }
 
+    /* package */static PendingIntent createPendingCallLogIntent(Context context) {
+        final Intent callLogIntent = PhoneGlobals.createCallLogIntent();
+        final TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(context);
+        taskStackBuilder.addNextIntent(callLogIntent);
+        return taskStackBuilder.getPendingIntent(0, 0);
+    }
+
     /**
      * Return an Intent that can be used to bring up the in-call screen.
      *