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

Commit 19d7eeae authored by Dongwon Kang's avatar Dongwon Kang Committed by Android (Google) Code Review
Browse files

Merge "PIP: Show recents again when PIP menu is closed" into nyc-dev

parents 1df15228 3ebc1e3f
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ import android.widget.ImageView;
import android.widget.TextView;

import com.android.systemui.R;
import com.android.systemui.SystemUI;
import com.android.systemui.SystemUIApplication;
import com.android.systemui.recents.Recents;

import static android.content.pm.PackageManager.FEATURE_LEANBACK;
import static android.content.pm.PackageManager.FEATURE_PICTURE_IN_PICTURE;
@@ -214,4 +217,18 @@ public class PipMenuActivity extends Activity implements PipManager.Listener {
        mPipManager.suspendPipResizing(
                PipManager.SUSPEND_PIP_RESIZE_REASON_WAITING_FOR_MENU_ACTIVITY_FINISH);
    }

    @Override
    public void finish() {
        super.finish();
        if (mPipManager.isRecentsShown()) {
            SystemUI[] services = ((SystemUIApplication) getApplication()).getServices();
            for (int i = services.length - 1; i >= 0; i--) {
                if (services[i] instanceof Recents) {
                    ((Recents) services[i]).showRecents(false, null);
                    break;
                }
            }
        }
    }
}