diff options
author | Raj Yengisetty <rajesh@cyngn.com> | 2015-04-13 14:08:27 -0700 |
---|---|---|
committer | Raj Yengisetty <rajesh@cyngn.com> | 2015-04-14 16:32:08 -0700 |
commit | ee224cb05e13d38c670733e59ae11b81515967b6 (patch) | |
tree | c505fa2ceb744598c2906161645d45685e36d7c0 | |
parent | 4a951b6c0def328802ebbcc21b00c6efd3817141 (diff) | |
download | android_packages_apps_Trebuchet-ee224cb05e13d38c670733e59ae11b81515967b6.tar.gz android_packages_apps_Trebuchet-ee224cb05e13d38c670733e59ae11b81515967b6.tar.bz2 android_packages_apps_Trebuchet-ee224cb05e13d38c670733e59ae11b81515967b6.zip |
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
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index be39e522c..7e280f266 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -46,6 +46,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; @@ -2606,6 +2607,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(); |