Merge "Changed to use the new hidden API." into main

This commit is contained in:
Rupesh Bansal
2024-11-07 06:53:27 +00:00
committed by Android (Google) Code Review
3 changed files with 7 additions and 6 deletions

View File

@@ -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.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED;
import static android.hardware.display.DisplayManager.EVENT_FLAG_DISPLAY_ADDED; 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_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.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 android.view.Display.INVALID_DISPLAY;
import static com.android.server.display.feature.flags.Flags.enableModeLimitForExternalDisplay; import static com.android.server.display.feature.flags.Flags.enableModeLimitForExternalDisplay;
@@ -159,8 +159,8 @@ public class ExternalDisplaySettingsConfiguration {
return; return;
} }
dm.registerDisplayListener(listener, mHandler, EVENT_FLAG_DISPLAY_ADDED dm.registerDisplayListener(listener, mHandler, EVENT_FLAG_DISPLAY_ADDED
| EVENT_FLAG_DISPLAY_CHANGED | EVENT_FLAG_DISPLAY_REMOVED | EVENT_FLAG_DISPLAY_CHANGED | EVENT_FLAG_DISPLAY_REMOVED,
| EVENT_FLAG_DISPLAY_CONNECTION_CHANGED); PRIVATE_EVENT_FLAG_DISPLAY_CONNECTION_CHANGED);
} }
/** /**

View File

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

View File

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