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

Commit 7e0404f1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Stop throwing exception when re-starting MediaProjection"

parents 15f1994b ef531e04
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ public final class MediaProjectionManager {
     * int, android.content.Intent)}
     * @param resultData The resulting data from {@link android.app.Activity#onActivityResult(int,
     * int, android.content.Intent)}
     * @throws IllegalStateException on pre-Q devices if a previously gotten MediaProjection
     * from the same {@code resultData} has not yet been stopped
     */
    public MediaProjection getMediaProjection(int resultCode, @NonNull Intent resultData) {
        if (resultCode != Activity.RESULT_OK || resultData == null) {
+3 −2
Original line number Diff line number Diff line
@@ -396,8 +396,9 @@ public final class MediaProjectionManagerService extends SystemService
            }
            synchronized (mLock) {
                if (isValidMediaProjection(asBinder())) {
                    throw new IllegalStateException(
                            "Cannot start already started MediaProjection");
                    Slog.w(TAG, "UID " + Binder.getCallingUid()
                            + " attempted to start already started MediaProjection");
                    return;
                }
                mCallback = callback;
                registerCallback(mCallback);