From d87e6c069914a6706dbde911c108abf8c29b0f60 Mon Sep 17 00:00:00 2001 From: Fiona Campbell Date: Fri, 5 Feb 2021 17:33:51 +0000 Subject: Move BrightnessSynchronizer to a display-specific folder. Bug: 159210246 Test: manual Change-Id: Idbd9a1affd8db66d13f5dd8f173d0e2d557e24d8 --- .../android/internal/BrightnessSynchronizer.java | 277 --------------------- .../internal/display/BrightnessSynchronizer.java | 277 +++++++++++++++++++++ core/java/com/android/internal/display/OWNERS | 3 + .../settings/brightness/BrightnessController.java | 2 +- .../display/AutomaticBrightnessController.java | 2 +- .../server/display/BrightnessMappingStrategy.java | 2 +- .../server/display/DisplayDeviceConfig.java | 2 +- .../android/server/display/DisplayDeviceInfo.java | 2 +- .../server/display/DisplayManagerService.java | 2 +- .../server/display/DisplayPowerController.java | 2 +- .../android/server/display/DisplayPowerState.java | 2 +- .../server/display/LocalDisplayAdapter.java | 2 +- .../com/android/server/display/RampAnimator.java | 2 +- .../com/android/server/lights/LightsService.java | 2 +- .../android/server/power/PowerManagerService.java | 2 +- 15 files changed, 292 insertions(+), 289 deletions(-) delete mode 100644 core/java/com/android/internal/BrightnessSynchronizer.java create mode 100644 core/java/com/android/internal/display/BrightnessSynchronizer.java create mode 100644 core/java/com/android/internal/display/OWNERS diff --git a/core/java/com/android/internal/BrightnessSynchronizer.java b/core/java/com/android/internal/BrightnessSynchronizer.java deleted file mode 100644 index 9049ca56bc53..000000000000 --- a/core/java/com/android/internal/BrightnessSynchronizer.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.internal; - - -import android.content.ContentResolver; -import android.content.Context; -import android.database.ContentObserver; -import android.net.Uri; -import android.os.Handler; -import android.os.Looper; -import android.os.Message; -import android.os.PowerManager; -import android.os.UserHandle; -import android.provider.Settings; -import android.util.MathUtils; - -import java.util.LinkedList; -import java.util.Queue; - -/** - * BrightnessSynchronizer helps convert between the int (old) system and float - * (new) system for storing the brightness. It has methods to convert between the two and also - * observes for when one of the settings is changed and syncs this with the other. - */ -public class BrightnessSynchronizer { - - private static final int MSG_UPDATE_FLOAT = 1; - private static final int MSG_UPDATE_INT = 2; - - private static final String TAG = "BrightnessSynchronizer"; - private static final Uri BRIGHTNESS_URI = - Settings.System.getUriFor(Settings.System.SCREEN_BRIGHTNESS); - private static final Uri BRIGHTNESS_FLOAT_URI = - Settings.System.getUriFor(Settings.System.SCREEN_BRIGHTNESS_FLOAT); - - // The tolerance within which we consider brightness values approximately equal to eachother. - // This value is approximately 1/3 of the smallest possible brightness value. - public static final float EPSILON = 0.001f; - - private final Context mContext; - - private final Queue mWriteHistory = new LinkedList<>(); - - private final Handler mHandler = new Handler(Looper.getMainLooper()) { - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - case MSG_UPDATE_FLOAT: - updateBrightnessFloatFromInt(msg.arg1); - break; - case MSG_UPDATE_INT: - updateBrightnessIntFromFloat(Float.intBitsToFloat(msg.arg1)); - break; - default: - super.handleMessage(msg); - } - - } - }; - - private float mPreferredSettingValue; - - public BrightnessSynchronizer(Context context) { - mContext = context; - } - - /** - * Starts brightnessSyncObserver to ensure that the float and int brightness values stay - * in sync. - * This also ensures that values are synchronized at system start up too. - * So we force an update to the int value, since float is the source of truth. Fallback to int - * value, if float is invalid. If both are invalid, use default float value from config. - */ - public void startSynchronizing() { - final BrightnessSyncObserver brightnessSyncObserver; - brightnessSyncObserver = new BrightnessSyncObserver(mHandler); - brightnessSyncObserver.startObserving(); - - final float currentFloatBrightness = getScreenBrightnessFloat(mContext); - final int currentIntBrightness = getScreenBrightnessInt(mContext); - - if (!Float.isNaN(currentFloatBrightness)) { - updateBrightnessIntFromFloat(currentFloatBrightness); - } else if (currentIntBrightness != -1) { - updateBrightnessFloatFromInt(currentIntBrightness); - } else { - final float defaultBrightness = mContext.getResources().getFloat( - com.android.internal.R.dimen.config_screenBrightnessSettingDefaultFloat); - Settings.System.putFloatForUser(mContext.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS_FLOAT, defaultBrightness, - UserHandle.USER_CURRENT); - - } - } - - /** - * Converts between the int brightness system and the float brightness system. - */ - public static float brightnessIntToFloat(int brightnessInt) { - if (brightnessInt == PowerManager.BRIGHTNESS_OFF) { - return PowerManager.BRIGHTNESS_OFF_FLOAT; - } else if (brightnessInt == PowerManager.BRIGHTNESS_INVALID) { - return PowerManager.BRIGHTNESS_INVALID_FLOAT; - } else { - final float minFloat = PowerManager.BRIGHTNESS_MIN; - final float maxFloat = PowerManager.BRIGHTNESS_MAX; - final float minInt = PowerManager.BRIGHTNESS_OFF + 1; - final float maxInt = PowerManager.BRIGHTNESS_ON; - return MathUtils.constrainedMap(minFloat, maxFloat, minInt, maxInt, brightnessInt); - } - } - - /** - * Converts between the float brightness system and the int brightness system. - */ - public static int brightnessFloatToInt(float brightnessFloat) { - return Math.round(brightnessFloatToIntRange(brightnessFloat)); - } - - /** - * Translates specified value from the float brightness system to the int brightness system, - * given the min/max of each range. Accounts for special values such as OFF and invalid values. - * Value returned as a float privimite (to preserve precision), but is a value within the - * int-system range. - */ - public static float brightnessFloatToIntRange(float brightnessFloat) { - if (floatEquals(brightnessFloat, PowerManager.BRIGHTNESS_OFF_FLOAT)) { - return PowerManager.BRIGHTNESS_OFF; - } else if (Float.isNaN(brightnessFloat)) { - return PowerManager.BRIGHTNESS_INVALID; - } else { - final float minFloat = PowerManager.BRIGHTNESS_MIN; - final float maxFloat = PowerManager.BRIGHTNESS_MAX; - final float minInt = PowerManager.BRIGHTNESS_OFF + 1; - final float maxInt = PowerManager.BRIGHTNESS_ON; - return MathUtils.constrainedMap(minInt, maxInt, minFloat, maxFloat, brightnessFloat); - } - } - - private static float getScreenBrightnessFloat(Context context) { - return Settings.System.getFloatForUser(context.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS_FLOAT, PowerManager.BRIGHTNESS_INVALID_FLOAT, - UserHandle.USER_CURRENT); - } - - private static int getScreenBrightnessInt(Context context) { - return Settings.System.getIntForUser(context.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS, PowerManager.BRIGHTNESS_INVALID, - UserHandle.USER_CURRENT); - } - - /** - * Updates the float setting based on a passed in int value. This is called whenever the int - * setting changes. mWriteHistory keeps a record of the values that been written to the settings - * from either this method or updateBrightnessIntFromFloat. This is to ensure that the value - * being set is due to an external value being set, rather than the updateBrightness* methods. - * The intention of this is to avoid race conditions when the setting is being changed - * frequently and to ensure we are not reacting to settings changes from this file. - * @param value Brightness value as int to store in the float setting. - */ - private void updateBrightnessFloatFromInt(int value) { - Object topOfQueue = mWriteHistory.peek(); - if (topOfQueue != null && topOfQueue.equals(value)) { - mWriteHistory.poll(); - } else { - if (brightnessFloatToInt(mPreferredSettingValue) == value) { - return; - } - float newBrightnessFloat = brightnessIntToFloat(value); - mWriteHistory.offer(newBrightnessFloat); - mPreferredSettingValue = newBrightnessFloat; - Settings.System.putFloatForUser(mContext.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS_FLOAT, newBrightnessFloat, - UserHandle.USER_CURRENT); - } - } - - /** - * Updates the int setting based on a passed in float value. This is called whenever the float - * setting changes. mWriteHistory keeps a record of the values that been written to the settings - * from either this method or updateBrightnessFloatFromInt. This is to ensure that the value - * being set is due to an external value being set, rather than the updateBrightness* methods. - * The intention of this is to avoid race conditions when the setting is being changed - * frequently and to ensure we are not reacting to settings changes from this file. - * @param value Brightness setting as float to store in int setting. - */ - private void updateBrightnessIntFromFloat(float value) { - int newBrightnessInt = brightnessFloatToInt(value); - Object topOfQueue = mWriteHistory.peek(); - if (topOfQueue != null && topOfQueue.equals(value)) { - mWriteHistory.poll(); - } else { - mWriteHistory.offer(newBrightnessInt); - mPreferredSettingValue = value; - Settings.System.putIntForUser(mContext.getContentResolver(), - Settings.System.SCREEN_BRIGHTNESS, newBrightnessInt, UserHandle.USER_CURRENT); - } - } - - /** - * Tests whether two brightness float values are within a small enough tolerance - * of each other. - * @param a first float to compare - * @param b second float to compare - * @return whether the two values are within a small enough tolerance value - */ - public static boolean floatEquals(float a, float b) { - if (a == b) { - return true; - } else if (Float.isNaN(a) && Float.isNaN(b)) { - return true; - } else if (Math.abs(a - b) < EPSILON) { - return true; - } else { - return false; - } - } - - private class BrightnessSyncObserver extends ContentObserver { - /** - * Creates a content observer. - * @param handler The handler to run {@link #onChange} on, or null if none. - */ - BrightnessSyncObserver(Handler handler) { - super(handler); - } - - @Override - public void onChange(boolean selfChange) { - onChange(selfChange, null); - } - - @Override - public void onChange(boolean selfChange, Uri uri) { - if (selfChange) { - return; - } - if (BRIGHTNESS_URI.equals(uri)) { - int currentBrightness = getScreenBrightnessInt(mContext); - mHandler.removeMessages(MSG_UPDATE_FLOAT); - mHandler.obtainMessage(MSG_UPDATE_FLOAT, currentBrightness, 0).sendToTarget(); - } else if (BRIGHTNESS_FLOAT_URI.equals(uri)) { - float currentFloat = getScreenBrightnessFloat(mContext); - int toSend = Float.floatToIntBits(currentFloat); - mHandler.removeMessages(MSG_UPDATE_INT); - mHandler.obtainMessage(MSG_UPDATE_INT, toSend, 0).sendToTarget(); - } - } - - public void startObserving() { - final ContentResolver cr = mContext.getContentResolver(); - cr.unregisterContentObserver(this); - cr.registerContentObserver(BRIGHTNESS_URI, false, this, UserHandle.USER_ALL); - cr.registerContentObserver(BRIGHTNESS_FLOAT_URI, false, this, UserHandle.USER_ALL); - } - - public void stopObserving() { - final ContentResolver cr = mContext.getContentResolver(); - cr.unregisterContentObserver(this); - } - } -} diff --git a/core/java/com/android/internal/display/BrightnessSynchronizer.java b/core/java/com/android/internal/display/BrightnessSynchronizer.java new file mode 100644 index 000000000000..fae58622d91e --- /dev/null +++ b/core/java/com/android/internal/display/BrightnessSynchronizer.java @@ -0,0 +1,277 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.internal.display; + + +import android.content.ContentResolver; +import android.content.Context; +import android.database.ContentObserver; +import android.net.Uri; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.os.PowerManager; +import android.os.UserHandle; +import android.provider.Settings; +import android.util.MathUtils; + +import java.util.LinkedList; +import java.util.Queue; + +/** + * BrightnessSynchronizer helps convert between the int (old) system and float + * (new) system for storing the brightness. It has methods to convert between the two and also + * observes for when one of the settings is changed and syncs this with the other. + */ +public class BrightnessSynchronizer { + + private static final int MSG_UPDATE_FLOAT = 1; + private static final int MSG_UPDATE_INT = 2; + + private static final String TAG = "BrightnessSynchronizer"; + private static final Uri BRIGHTNESS_URI = + Settings.System.getUriFor(Settings.System.SCREEN_BRIGHTNESS); + private static final Uri BRIGHTNESS_FLOAT_URI = + Settings.System.getUriFor(Settings.System.SCREEN_BRIGHTNESS_FLOAT); + + // The tolerance within which we consider brightness values approximately equal to eachother. + // This value is approximately 1/3 of the smallest possible brightness value. + public static final float EPSILON = 0.001f; + + private final Context mContext; + + private final Queue mWriteHistory = new LinkedList<>(); + + private final Handler mHandler = new Handler(Looper.getMainLooper()) { + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case MSG_UPDATE_FLOAT: + updateBrightnessFloatFromInt(msg.arg1); + break; + case MSG_UPDATE_INT: + updateBrightnessIntFromFloat(Float.intBitsToFloat(msg.arg1)); + break; + default: + super.handleMessage(msg); + } + + } + }; + + private float mPreferredSettingValue; + + public BrightnessSynchronizer(Context context) { + mContext = context; + } + + /** + * Starts brightnessSyncObserver to ensure that the float and int brightness values stay + * in sync. + * This also ensures that values are synchronized at system start up too. + * So we force an update to the int value, since float is the source of truth. Fallback to int + * value, if float is invalid. If both are invalid, use default float value from config. + */ + public void startSynchronizing() { + final BrightnessSyncObserver brightnessSyncObserver; + brightnessSyncObserver = new BrightnessSyncObserver(mHandler); + brightnessSyncObserver.startObserving(); + + final float currentFloatBrightness = getScreenBrightnessFloat(mContext); + final int currentIntBrightness = getScreenBrightnessInt(mContext); + + if (!Float.isNaN(currentFloatBrightness)) { + updateBrightnessIntFromFloat(currentFloatBrightness); + } else if (currentIntBrightness != -1) { + updateBrightnessFloatFromInt(currentIntBrightness); + } else { + final float defaultBrightness = mContext.getResources().getFloat( + com.android.internal.R.dimen.config_screenBrightnessSettingDefaultFloat); + Settings.System.putFloatForUser(mContext.getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS_FLOAT, defaultBrightness, + UserHandle.USER_CURRENT); + + } + } + + /** + * Converts between the int brightness system and the float brightness system. + */ + public static float brightnessIntToFloat(int brightnessInt) { + if (brightnessInt == PowerManager.BRIGHTNESS_OFF) { + return PowerManager.BRIGHTNESS_OFF_FLOAT; + } else if (brightnessInt == PowerManager.BRIGHTNESS_INVALID) { + return PowerManager.BRIGHTNESS_INVALID_FLOAT; + } else { + final float minFloat = PowerManager.BRIGHTNESS_MIN; + final float maxFloat = PowerManager.BRIGHTNESS_MAX; + final float minInt = PowerManager.BRIGHTNESS_OFF + 1; + final float maxInt = PowerManager.BRIGHTNESS_ON; + return MathUtils.constrainedMap(minFloat, maxFloat, minInt, maxInt, brightnessInt); + } + } + + /** + * Converts between the float brightness system and the int brightness system. + */ + public static int brightnessFloatToInt(float brightnessFloat) { + return Math.round(brightnessFloatToIntRange(brightnessFloat)); + } + + /** + * Translates specified value from the float brightness system to the int brightness system, + * given the min/max of each range. Accounts for special values such as OFF and invalid values. + * Value returned as a float privimite (to preserve precision), but is a value within the + * int-system range. + */ + public static float brightnessFloatToIntRange(float brightnessFloat) { + if (floatEquals(brightnessFloat, PowerManager.BRIGHTNESS_OFF_FLOAT)) { + return PowerManager.BRIGHTNESS_OFF; + } else if (Float.isNaN(brightnessFloat)) { + return PowerManager.BRIGHTNESS_INVALID; + } else { + final float minFloat = PowerManager.BRIGHTNESS_MIN; + final float maxFloat = PowerManager.BRIGHTNESS_MAX; + final float minInt = PowerManager.BRIGHTNESS_OFF + 1; + final float maxInt = PowerManager.BRIGHTNESS_ON; + return MathUtils.constrainedMap(minInt, maxInt, minFloat, maxFloat, brightnessFloat); + } + } + + private static float getScreenBrightnessFloat(Context context) { + return Settings.System.getFloatForUser(context.getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS_FLOAT, PowerManager.BRIGHTNESS_INVALID_FLOAT, + UserHandle.USER_CURRENT); + } + + private static int getScreenBrightnessInt(Context context) { + return Settings.System.getIntForUser(context.getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS, PowerManager.BRIGHTNESS_INVALID, + UserHandle.USER_CURRENT); + } + + /** + * Updates the float setting based on a passed in int value. This is called whenever the int + * setting changes. mWriteHistory keeps a record of the values that been written to the settings + * from either this method or updateBrightnessIntFromFloat. This is to ensure that the value + * being set is due to an external value being set, rather than the updateBrightness* methods. + * The intention of this is to avoid race conditions when the setting is being changed + * frequently and to ensure we are not reacting to settings changes from this file. + * @param value Brightness value as int to store in the float setting. + */ + private void updateBrightnessFloatFromInt(int value) { + Object topOfQueue = mWriteHistory.peek(); + if (topOfQueue != null && topOfQueue.equals(value)) { + mWriteHistory.poll(); + } else { + if (brightnessFloatToInt(mPreferredSettingValue) == value) { + return; + } + float newBrightnessFloat = brightnessIntToFloat(value); + mWriteHistory.offer(newBrightnessFloat); + mPreferredSettingValue = newBrightnessFloat; + Settings.System.putFloatForUser(mContext.getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS_FLOAT, newBrightnessFloat, + UserHandle.USER_CURRENT); + } + } + + /** + * Updates the int setting based on a passed in float value. This is called whenever the float + * setting changes. mWriteHistory keeps a record of the values that been written to the settings + * from either this method or updateBrightnessFloatFromInt. This is to ensure that the value + * being set is due to an external value being set, rather than the updateBrightness* methods. + * The intention of this is to avoid race conditions when the setting is being changed + * frequently and to ensure we are not reacting to settings changes from this file. + * @param value Brightness setting as float to store in int setting. + */ + private void updateBrightnessIntFromFloat(float value) { + int newBrightnessInt = brightnessFloatToInt(value); + Object topOfQueue = mWriteHistory.peek(); + if (topOfQueue != null && topOfQueue.equals(value)) { + mWriteHistory.poll(); + } else { + mWriteHistory.offer(newBrightnessInt); + mPreferredSettingValue = value; + Settings.System.putIntForUser(mContext.getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS, newBrightnessInt, UserHandle.USER_CURRENT); + } + } + + /** + * Tests whether two brightness float values are within a small enough tolerance + * of each other. + * @param a first float to compare + * @param b second float to compare + * @return whether the two values are within a small enough tolerance value + */ + public static boolean floatEquals(float a, float b) { + if (a == b) { + return true; + } else if (Float.isNaN(a) && Float.isNaN(b)) { + return true; + } else if (Math.abs(a - b) < EPSILON) { + return true; + } else { + return false; + } + } + + private class BrightnessSyncObserver extends ContentObserver { + /** + * Creates a content observer. + * @param handler The handler to run {@link #onChange} on, or null if none. + */ + BrightnessSyncObserver(Handler handler) { + super(handler); + } + + @Override + public void onChange(boolean selfChange) { + onChange(selfChange, null); + } + + @Override + public void onChange(boolean selfChange, Uri uri) { + if (selfChange) { + return; + } + if (BRIGHTNESS_URI.equals(uri)) { + int currentBrightness = getScreenBrightnessInt(mContext); + mHandler.removeMessages(MSG_UPDATE_FLOAT); + mHandler.obtainMessage(MSG_UPDATE_FLOAT, currentBrightness, 0).sendToTarget(); + } else if (BRIGHTNESS_FLOAT_URI.equals(uri)) { + float currentFloat = getScreenBrightnessFloat(mContext); + int toSend = Float.floatToIntBits(currentFloat); + mHandler.removeMessages(MSG_UPDATE_INT); + mHandler.obtainMessage(MSG_UPDATE_INT, toSend, 0).sendToTarget(); + } + } + + public void startObserving() { + final ContentResolver cr = mContext.getContentResolver(); + cr.unregisterContentObserver(this); + cr.registerContentObserver(BRIGHTNESS_URI, false, this, UserHandle.USER_ALL); + cr.registerContentObserver(BRIGHTNESS_FLOAT_URI, false, this, UserHandle.USER_ALL); + } + + public void stopObserving() { + final ContentResolver cr = mContext.getContentResolver(); + cr.unregisterContentObserver(this); + } + } +} diff --git a/core/java/com/android/internal/display/OWNERS b/core/java/com/android/internal/display/OWNERS new file mode 100644 index 000000000000..20b75be9f11f --- /dev/null +++ b/core/java/com/android/internal/display/OWNERS @@ -0,0 +1,3 @@ +include /services/core/java/com/android/server/display/OWNERS + +flc@google.com diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java index 43bb34380f80..0bfc8e5d554b 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java +++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java @@ -41,7 +41,7 @@ import android.service.vr.IVrStateCallbacks; import android.util.Log; import android.util.MathUtils; -import com.android.internal.BrightnessSynchronizer; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.settingslib.RestrictedLockUtilsInternal; diff --git a/services/core/java/com/android/server/display/AutomaticBrightnessController.java b/services/core/java/com/android/server/display/AutomaticBrightnessController.java index fa063b223250..225da7ad87b3 100644 --- a/services/core/java/com/android/server/display/AutomaticBrightnessController.java +++ b/services/core/java/com/android/server/display/AutomaticBrightnessController.java @@ -42,8 +42,8 @@ import android.util.MathUtils; import android.util.Slog; import android.util.TimeUtils; -import com.android.internal.BrightnessSynchronizer; import com.android.internal.annotations.VisibleForTesting; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.os.BackgroundThread; import com.android.server.EventLogTags; import com.android.server.display.DisplayDeviceConfig.HighBrightnessModeData; diff --git a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java index 4832e46be8a8..a62f67a743ad 100644 --- a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java +++ b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java @@ -28,8 +28,8 @@ import android.util.Pair; import android.util.Slog; import android.util.Spline; -import com.android.internal.BrightnessSynchronizer; import com.android.internal.annotations.VisibleForTesting; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.util.Preconditions; import com.android.server.display.utils.Plog; diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java index d6872217eab6..1b25427adf71 100644 --- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java +++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java @@ -23,8 +23,8 @@ import android.os.PowerManager; import android.util.Slog; import android.view.DisplayAddress; -import com.android.internal.BrightnessSynchronizer; import com.android.internal.R; +import com.android.internal.display.BrightnessSynchronizer; import com.android.server.display.config.DisplayConfiguration; import com.android.server.display.config.DisplayQuirks; import com.android.server.display.config.HbmTiming; diff --git a/services/core/java/com/android/server/display/DisplayDeviceInfo.java b/services/core/java/com/android/server/display/DisplayDeviceInfo.java index bf16a6d5efb9..501533d535d3 100644 --- a/services/core/java/com/android/server/display/DisplayDeviceInfo.java +++ b/services/core/java/com/android/server/display/DisplayDeviceInfo.java @@ -26,7 +26,7 @@ import android.view.DisplayEventReceiver; import android.view.RoundedCorners; import android.view.Surface; -import com.android.internal.BrightnessSynchronizer; +import com.android.internal.display.BrightnessSynchronizer; import java.util.Arrays; import java.util.Objects; diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java index 01fee5645475..dce6375ab73c 100644 --- a/services/core/java/com/android/server/display/DisplayManagerService.java +++ b/services/core/java/com/android/server/display/DisplayManagerService.java @@ -106,9 +106,9 @@ import android.view.DisplayInfo; import android.view.Surface; import android.view.SurfaceControl; -import com.android.internal.BrightnessSynchronizer; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.util.DumpUtils; import com.android.internal.util.IndentingPrintWriter; import com.android.server.AnimationThread; diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java index 2df336528939..9320f5027ce0 100644 --- a/services/core/java/com/android/server/display/DisplayPowerController.java +++ b/services/core/java/com/android/server/display/DisplayPowerController.java @@ -53,8 +53,8 @@ import android.util.Slog; import android.util.TimeUtils; import android.view.Display; -import com.android.internal.BrightnessSynchronizer; import com.android.internal.app.IBatteryStats; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.server.LocalServices; diff --git a/services/core/java/com/android/server/display/DisplayPowerState.java b/services/core/java/com/android/server/display/DisplayPowerState.java index 173adce00cd9..1d20d878fb81 100644 --- a/services/core/java/com/android/server/display/DisplayPowerState.java +++ b/services/core/java/com/android/server/display/DisplayPowerState.java @@ -26,7 +26,7 @@ import android.util.Slog; import android.view.Choreographer; import android.view.Display; -import com.android.internal.BrightnessSynchronizer; +import com.android.internal.display.BrightnessSynchronizer; import java.io.PrintWriter; diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java index 73ebb2e48037..3b66236c9f0f 100644 --- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java @@ -38,7 +38,7 @@ import android.view.DisplayEventReceiver; import android.view.RoundedCorners; import android.view.SurfaceControl; -import com.android.internal.BrightnessSynchronizer; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.os.BackgroundThread; import com.android.internal.util.function.pooled.PooledLambda; import com.android.server.LocalServices; diff --git a/services/core/java/com/android/server/display/RampAnimator.java b/services/core/java/com/android/server/display/RampAnimator.java index 7916d816dc9b..26004a8da1a1 100644 --- a/services/core/java/com/android/server/display/RampAnimator.java +++ b/services/core/java/com/android/server/display/RampAnimator.java @@ -20,7 +20,7 @@ import android.animation.ValueAnimator; import android.util.FloatProperty; import android.view.Choreographer; -import com.android.internal.BrightnessSynchronizer; +import com.android.internal.display.BrightnessSynchronizer; /** * A custom animator that progressively updates a property value at diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java index 43c965dde27b..42b0add6136e 100644 --- a/services/core/java/com/android/server/lights/LightsService.java +++ b/services/core/java/com/android/server/lights/LightsService.java @@ -36,9 +36,9 @@ import android.provider.Settings; import android.util.Slog; import android.util.SparseArray; -import com.android.internal.BrightnessSynchronizer; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.util.DumpUtils; import com.android.internal.util.Preconditions; import com.android.server.SystemService; diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 8e0d632dd1a8..88fdc4aad5cf 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -90,11 +90,11 @@ import android.util.proto.ProtoOutputStream; import android.view.Display; import android.view.KeyEvent; -import com.android.internal.BrightnessSynchronizer; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.IAppOpsService; import com.android.internal.app.IBatteryStats; +import com.android.internal.display.BrightnessSynchronizer; import com.android.internal.os.BackgroundThread; import com.android.internal.util.DumpUtils; import com.android.internal.util.Preconditions; -- cgit v1.2.3-59-g8ed1b