Ensure that we capture all paths for starting activity for result

-> AppWidgetManagerCompatVL uses an IntentSender to launch the widget
   config activity (to handle the case of cross profile config activities)
-> Launcher was not overriding this method, and so not capturing the fact
   that we are waiting for a result.

issue 19723510

Change-Id: If5751e6d23d31c9f7b3b85f9464a93f935487cec
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index a8fd79e..56a74e5 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -42,6 +42,7 @@
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.IntentSender;
 import android.content.SharedPreferences;
 import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
@@ -2079,10 +2080,26 @@
 
     @Override
     public void startActivityForResult(Intent intent, int requestCode) {
+        onStartForResult(requestCode);
+        super.startActivityForResult(intent, requestCode);
+    }
+
+    @Override
+    public void startIntentSenderForResult (IntentSender intent, int requestCode,
+            Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) {
+        onStartForResult(requestCode);
+        try {
+            super.startIntentSenderForResult(intent, requestCode,
+                fillInIntent, flagsMask, flagsValues, extraFlags, options);
+        } catch (IntentSender.SendIntentException e) {
+            throw new ActivityNotFoundException();
+        }
+    }
+
+    private void onStartForResult(int requestCode) {
         if (requestCode >= 0) {
             setWaitingForResult(true);
         }
-        super.startActivityForResult(intent, requestCode);
     }
 
     /**