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

Commit ee8c9c63 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Add NoDisplay test when resuming Activity

When an activity has no display [i.e. it's invisible], it
must call finish() before onResume() completes

Bug: 18279655
Change-Id: I2b8562b852c05fdfff4e6a6922ce47e9e948a880
parent fbba3f41
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -6068,6 +6068,17 @@ public class Activity extends ContextThemeWrapper
                " did not call through to super.onResume()");
        }

        // invisible activities must be finished before onResume() completes
        if (!mVisibleFromClient && !mFinished) {
            Log.w(TAG, "An activity without a UI must call finish() before onResume() completes");
            if (getApplicationInfo().targetSdkVersion
                    > android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {
                throw new IllegalStateException(
                        "Activity " + mComponent.toShortString() +
                        " did not call finish() prior to onResume() completing");
            }
        }

        // Now really resume, and install the current status bar and menu.
        mCalled = false;