Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c2b175d authored by Ken Wakasa's avatar Ken Wakasa
Browse files

Prevent crashes when IME's settings activity is missing

bug: 5029444
Change-Id: I5c045123dbca2581f2e7d9f602e7511398b83504
parent 1a787cf3
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import com.android.settings.SettingsPreferenceFragment;

import android.app.AlertDialog;
import android.app.Fragment;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
@@ -102,7 +103,13 @@ public class InputMethodPreference extends CheckBoxPreference
                    new OnClickListener() {
                        @Override
                        public void onClick(View arg0) {
                            try {
                                mFragment.startActivity(mSettingsIntent);
                            } catch (ActivityNotFoundException e) {
                                Log.d(TAG, "IME's Settings Activity Not Found: " + e);
                                // If the IME's settings activity does not exist, we can just
                                // do nothing...
                            }
                        }
                    });
        }