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

Commit 3f83d163 authored by Massimo Carli's avatar Massimo Carli Committed by Android (Google) Code Review
Browse files

Merge "Fix possible NPE in TransparentPolicy" into main

parents 51982c54 6713edc5
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -162,10 +162,6 @@ class TransparentPolicy {
        mTransparentPolicyState.clearInheritedCompatDisplayInsets();
    }

    TransparentPolicyState getTransparentPolicyState() {
        return mTransparentPolicyState;
    }

    /**
     * In case of translucent activities, it consumes the {@link ActivityRecord} of the first opaque
     * activity beneath using the given consumer and returns {@code true}.
@@ -176,7 +172,7 @@ class TransparentPolicy {

    @NonNull
    Optional<ActivityRecord> getFirstOpaqueActivity() {
        return isRunning() ? Optional.of(mTransparentPolicyState.mFirstOpaqueActivity)
        return isRunning() ? Optional.ofNullable(mTransparentPolicyState.mFirstOpaqueActivity)
                : Optional.empty();
    }

@@ -216,10 +212,6 @@ class TransparentPolicy {
                SMALLEST_SCREEN_WIDTH_DP_UNDEFINED;
    }

    private void inheritConfiguration(ActivityRecord firstOpaque) {
        mTransparentPolicyState.inheritFromOpaque(firstOpaque);
    }

    /**
     * Encapsulate the state for the current translucent activity when the transparent policy
     * has started.