Fix issue #2093608: Calendar widget takes a few seconds to launch

Avert your eyes!

The key change here is that RemoteViews can now call a Context API to
start its pending intent, which inside of the activity manager we can
use to determine to cancel the timeout delay for external entities
to disrupt the home screen.

Change-Id: If097cf7478cbed7a3c04a304050bd7fd5703d197
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 722c75c..82d49e3 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -21,6 +21,7 @@
 import android.content.IntentFilter;
 import android.content.IIntentSender;
 import android.content.IIntentReceiver;
+import android.content.IntentSender;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.ConfigurationInfo;
 import android.content.pm.IPackageDataObserver;
@@ -145,12 +146,12 @@
             return true;
         }
 
-        case START_ACTIVITY_PENDING_INTENT_TRANSACTION:
+        case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
         {
             data.enforceInterface(IActivityManager.descriptor);
             IBinder b = data.readStrongBinder();
             IApplicationThread app = ApplicationThreadNative.asInterface(b);
-            PendingIntent intent = PendingIntent.CREATOR.createFromParcel(data);
+            IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
             Intent fillInIntent = null;
             if (data.readInt() != 0) {
                 fillInIntent = Intent.CREATOR.createFromParcel(data);
@@ -161,7 +162,7 @@
             int requestCode = data.readInt();
             int flagsMask = data.readInt();
             int flagsValues = data.readInt();
-            int result = startActivityPendingIntent(app, intent,
+            int result = startActivityIntentSender(app, intent,
                     fillInIntent, resolvedType, resultTo, resultWho,
                     requestCode, flagsMask, flagsValues);
             reply.writeNoException();
@@ -1202,8 +1203,8 @@
         data.recycle();
         return result;
     }
-    public int startActivityPendingIntent(IApplicationThread caller,
-            PendingIntent intent, Intent fillInIntent, String resolvedType,
+    public int startActivityIntentSender(IApplicationThread caller,
+            IntentSender intent, Intent fillInIntent, String resolvedType,
             IBinder resultTo, String resultWho, int requestCode,
             int flagsMask, int flagsValues) throws RemoteException {
         Parcel data = Parcel.obtain();
@@ -1223,7 +1224,7 @@
         data.writeInt(requestCode);
         data.writeInt(flagsMask);
         data.writeInt(flagsValues);
-        mRemote.transact(START_ACTIVITY_PENDING_INTENT_TRANSACTION, data, reply, 0);
+        mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
         reply.readException();
         int result = reply.readInt();
         reply.recycle();