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

Commit 669ad673 authored by Sergey Vasilinets's avatar Sergey Vasilinets
Browse files

Disallow reflection on Display.getDisplayInfo and Display.displayCutout

Display.getCutout() should be used instead.

Test: N/A
bug: 123769394
Change-Id: Ib714dd71d749027a58f36aedb2f25ceb481ae342
parent de626e05
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManagerGlobal;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Process;
@@ -495,7 +496,7 @@ public final class Display {
     * @return True if the display is still valid.
     * @hide
     */
    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    public boolean getDisplayInfo(DisplayInfo outDisplayInfo) {
        synchronized (this) {
            updateDisplayInfoLocked();
+3 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.annotation.UnsupportedAppUsage;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.ArraySet;
@@ -157,8 +158,9 @@ public final class DisplayInfo implements Parcelable {
     *
     * @hide
     */
    // Remark on @UnsupportedAppUsage: Display.getCutout should be used instead
    @Nullable
    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    public DisplayCutout displayCutout;

    /**