summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2015-04-13 21:08:27 (GMT)
committerMatt Garnes <matt@cyngn.com>2015-04-15 00:03:03 (GMT)
commit8c2c0a406dbc36aeff4c23763d6aa83ddaf624e9 (patch)
treee73bcdd711b08a3494f46cf32c25d20cd6ae85e9
parent43119c63f931f7030f0e92bdbc02fd572caae9e4 (diff)
downloadandroid_packages_apps_Trebuchet-8c2c0a406dbc36aeff4c23763d6aa83ddaf624e9.zip
android_packages_apps_Trebuchet-8c2c0a406dbc36aeff4c23763d6aa83ddaf624e9.tar.gz
android_packages_apps_Trebuchet-8c2c0a406dbc36aeff4c23763d6aa83ddaf624e9.tar.bz2
Trebuchet: Fix NPE when adding widgets
Make sure to setWaitingForResult on startIntentSenderForResult so that mPendingAddInfo is saved Repro: Change orientation when in the config activity for a widget Change-Id: I76ecc2b69b7f4a1cda65a481699aa79ae67f767a (cherry picked from commit ee224cb05e13d38c670733e59ae11b81515967b6) (cherry picked from commit 9f86f89d838352f825196b2ac34813a3336dd216)
-rw-r--r--src/com/android/launcher3/Launcher.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 647143f..cfa9100 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -45,6 +45,7 @@ import android.content.Context;
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;
@@ -2604,6 +2605,30 @@ public class Launcher extends Activity
}
}
+ /**
+ * This is used when starting widget config activities. Make sure to setWaitingForResult so that
+ * the ItemInfo for the pending item is properly saved.
+ *
+ * @param intent
+ * @param requestCode
+ * @param fillInIntent
+ * @param flagsMask
+ * @param flagsValues
+ * @param extraFlags
+ * @param options
+ * @throws IntentSender.SendIntentException
+ */
+ @Override
+ public void startIntentSenderForResult(IntentSender intent, int requestCode,
+ Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options)
+ throws IntentSender.SendIntentException {
+ if (requestCode >= 0) {
+ setWaitingForResult(true);
+ }
+ super.startIntentSenderForResult(intent, requestCode, fillInIntent, flagsMask, flagsValues,
+ extraFlags, options);
+ }
+
protected void moveToCustomContentScreen(boolean animate) {
// Close any folders that may be open.
closeFolder();