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

Commit 24f961a0 authored by Rupesh Bansal's avatar Rupesh Bansal
Browse files

Changed to use the new hidden API.

Bug: 372700957
Test: refactoring
Flag: EXEMPT Refactoring
Change-Id: I5eb7d5ab94ebd273aea9226cd3cbed5de0d49baa
parent 214a71a6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@ import static android.content.Context.DISPLAY_SERVICE;
import static android.hardware.display.DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED;
import static android.hardware.display.DisplayManager.EVENT_FLAG_DISPLAY_ADDED;
import static android.hardware.display.DisplayManager.EVENT_FLAG_DISPLAY_CHANGED;
import static android.hardware.display.DisplayManager.EVENT_FLAG_DISPLAY_CONNECTION_CHANGED;
import static android.hardware.display.DisplayManager.EVENT_FLAG_DISPLAY_REMOVED;
import static android.hardware.display.DisplayManager.PRIVATE_EVENT_FLAG_DISPLAY_CONNECTION_CHANGED;
import static android.view.Display.INVALID_DISPLAY;

import static com.android.server.display.feature.flags.Flags.enableModeLimitForExternalDisplay;
@@ -159,8 +159,8 @@ public class ExternalDisplaySettingsConfiguration {
                return;
            }
            dm.registerDisplayListener(listener, mHandler, EVENT_FLAG_DISPLAY_ADDED
                    | EVENT_FLAG_DISPLAY_CHANGED | EVENT_FLAG_DISPLAY_REMOVED
                    | EVENT_FLAG_DISPLAY_CONNECTION_CHANGED);
                    | EVENT_FLAG_DISPLAY_CHANGED | EVENT_FLAG_DISPLAY_REMOVED,
                    PRIVATE_EVENT_FLAG_DISPLAY_CONNECTION_CHANGED);
        }

        /**
+2 −2
Original line number Diff line number Diff line
@@ -133,8 +133,8 @@ public class BrightnessLevelPreferenceController extends BasePreferenceControlle
    @Override
    public void onStart() {
        mContentResolver.registerContentObserver(BRIGHTNESS_ADJ_URI, false, mBrightnessObserver);
        mDisplayManager.registerDisplayListener(mDisplayListener, mHandler,
                DisplayManager.EVENT_FLAG_DISPLAY_BRIGHTNESS);
        mDisplayManager.registerDisplayListener(mDisplayListener, mHandler, /* eventFlags= */ 0,
                DisplayManager.PRIVATE_EVENT_FLAG_DISPLAY_BRIGHTNESS);
        updatedSummary(mPreference);
    }

+2 −1
Original line number Diff line number Diff line
@@ -107,7 +107,8 @@ class BrightnessLevelRestrictedPreference :
        context.displayManager.registerDisplayListener(
            listener,
            HandlerExecutor.main,
            DisplayManager.EVENT_FLAG_DISPLAY_BRIGHTNESS,
            /* eventFlags= */ 0,
            DisplayManager.PRIVATE_EVENT_FLAG_DISPLAY_BRIGHTNESS,
        )
    }