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

Commit d0ca0e09 authored by George Mount's avatar George Mount
Browse files

Ensure window has been added in isTopOfTask

Bug 27893230

When isTopOfTask is called prior to the window being added, it
will throw an IllegalArgumentException. This checks that the
window has been added before making the call.

Change-Id: Idd14c0f1051e16d96a0a1fa9f990f380a1f69911
parent f20ce471
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -5920,6 +5920,9 @@ public class Activity extends ContextThemeWrapper
     * @return true if this is the topmost, non-finishing activity in its task.
     * @return true if this is the topmost, non-finishing activity in its task.
     */
     */
    private boolean isTopOfTask() {
    private boolean isTopOfTask() {
        if (mToken == null || mWindow == null || !mWindowAdded) {
            return false;
        }
        try {
        try {
            return ActivityManagerNative.getDefault().isTopOfTask(mToken);
            return ActivityManagerNative.getDefault().isTopOfTask(mToken);
        } catch (RemoteException e) {
        } catch (RemoteException e) {