am 6d85d168: am d2975f9d: am d9774c9f: am cdcba9ce: Merge "Fix crashes in Settings" into mnc-dr-dev

* commit '6d85d1686e6a333fe990d9e3ae5b978e8a8ce8c2':
  Fix crashes in Settings
This commit is contained in:
Jason Monk
2015-10-16 16:56:40 +00:00
committed by Android Git Automerger
2 changed files with 5 additions and 23 deletions

View File

@@ -56,7 +56,10 @@ public class UserDictionaryAddWordActivity extends Activity {
// The following will get the EXTRA_WORD and EXTRA_LOCALE fields that are in the intent.
// We do need to add the action by hand, because UserDictionaryAddWordContents expects
// it to be in the bundle, in the EXTRA_MODE key.
final Bundle args = intent.getExtras();
Bundle args = intent.getExtras();
if (args == null) {
args = new Bundle();
}
args.putInt(UserDictionaryAddWordContents.EXTRA_MODE, mode);
if (null != savedInstanceState) {
@@ -74,6 +77,7 @@ public class UserDictionaryAddWordActivity extends Activity {
private void reportBackToCaller(final int resultCode, final Bundle result) {
final Intent senderIntent = getIntent();
if (senderIntent.getExtras() == null) return;
final Object listener = senderIntent.getExtras().get("listener");
if (!(listener instanceof Messenger)) return; // This will work if listener is null too.
final Messenger messenger = (Messenger)listener;