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

Commit 38382a44 authored by Mikhail Malakhov's avatar Mikhail Malakhov Committed by android-build-merger
Browse files

Merge "Sometime, Settings app crash when AllowBindAppWidgetActivity closing"...

Merge "Sometime, Settings app crash when AllowBindAppWidgetActivity closing" am: c7697e9b am: 933cdd55
am: 07303930

Change-Id: Ia65d7c966350dac44a1d15a5781d051df8d464cd
parents ea71adb7 07303930
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -52,9 +52,8 @@ public class AllowBindAppWidgetActivity extends AlertActivity implements
    private boolean mClicked;

    public void onClick(DialogInterface dialog, int which) {
        mClicked = true;
        if (which == AlertDialog.BUTTON_POSITIVE) {
            // By default, set the result to cancelled
            setResult(RESULT_CANCELED);
            if (mAppWidgetId != -1 && mComponentName != null && mCallingPackage != null) {
                try {
                    final boolean bound = mAppWidgetManager.bindAppWidgetIdIfAllowed(mAppWidgetId,
@@ -80,15 +79,18 @@ public class AllowBindAppWidgetActivity extends AlertActivity implements
        finish();
    }

    @Override
    protected void onPause() {
        if (isDestroyed() && !mClicked) {
            setResult(RESULT_CANCELED);
        if (!mClicked) { // RESULT_CANCELED
            finish();
        }
        super.onDestroy();
        super.onPause();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setResult(RESULT_CANCELED); // By default, set the result to cancelled
        Intent intent = getIntent();
        CharSequence label = "";
        if (intent != null) {
@@ -112,7 +114,6 @@ public class AllowBindAppWidgetActivity extends AlertActivity implements
                mComponentName = null;
                mCallingPackage = null;
                Log.v("BIND_APPWIDGET", "Error getting parameters");
                setResult(RESULT_CANCELED);
                finish();
                return;
            }