Merge "Add logging for rbc on / off" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7c0f7188a9
@@ -796,6 +796,7 @@ public class BrightnessTracker {
|
|||||||
pw.print(", isUserSetBrightness=" + events[i].isUserSetBrightness);
|
pw.print(", isUserSetBrightness=" + events[i].isUserSetBrightness);
|
||||||
pw.print(", powerBrightnessFactor=" + events[i].powerBrightnessFactor);
|
pw.print(", powerBrightnessFactor=" + events[i].powerBrightnessFactor);
|
||||||
pw.print(", isDefaultBrightnessConfig=" + events[i].isDefaultBrightnessConfig);
|
pw.print(", isDefaultBrightnessConfig=" + events[i].isDefaultBrightnessConfig);
|
||||||
|
pw.print(", recent lux values=");
|
||||||
pw.print(" {");
|
pw.print(" {");
|
||||||
for (int j = 0; j < events[i].luxValues.length; ++j){
|
for (int j = 0; j < events[i].luxValues.length; ++j){
|
||||||
if (j != 0) {
|
if (j != 0) {
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
|
|||||||
private static final int REPORTED_TO_POLICY_SCREEN_TURNING_OFF = 3;
|
private static final int REPORTED_TO_POLICY_SCREEN_TURNING_OFF = 3;
|
||||||
|
|
||||||
private static final int RINGBUFFER_MAX = 100;
|
private static final int RINGBUFFER_MAX = 100;
|
||||||
|
private static final int RINGBUFFER_RBC_MAX = 20;
|
||||||
|
|
||||||
private static final float[] BRIGHTNESS_RANGE_BOUNDARIES = {
|
private static final float[] BRIGHTNESS_RANGE_BOUNDARIES = {
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80,
|
||||||
@@ -390,6 +391,10 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
|
|||||||
// Keeps a record of brightness changes for dumpsys.
|
// Keeps a record of brightness changes for dumpsys.
|
||||||
private RingBuffer<BrightnessEvent> mBrightnessEventRingBuffer;
|
private RingBuffer<BrightnessEvent> mBrightnessEventRingBuffer;
|
||||||
|
|
||||||
|
// Keeps a record of rbc changes for dumpsys.
|
||||||
|
private final RingBuffer<BrightnessEvent> mRbcEventRingBuffer =
|
||||||
|
new RingBuffer<>(BrightnessEvent.class, RINGBUFFER_RBC_MAX);
|
||||||
|
|
||||||
// Controls and tracks all the wakelocks that are acquired/released by the system. Also acts as
|
// Controls and tracks all the wakelocks that are acquired/released by the system. Also acts as
|
||||||
// a medium of communication between this class and the PowerManagerService.
|
// a medium of communication between this class and the PowerManagerService.
|
||||||
private final WakelockController mWakelockController;
|
private final WakelockController mWakelockController;
|
||||||
@@ -1593,6 +1598,10 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
|
|||||||
mTempBrightnessEvent.getReason().getReason() == BrightnessReason.REASON_TEMPORARY
|
mTempBrightnessEvent.getReason().getReason() == BrightnessReason.REASON_TEMPORARY
|
||||||
&& mLastBrightnessEvent.getReason().getReason()
|
&& mLastBrightnessEvent.getReason().getReason()
|
||||||
== BrightnessReason.REASON_TEMPORARY;
|
== BrightnessReason.REASON_TEMPORARY;
|
||||||
|
// Purely for dumpsys;
|
||||||
|
final boolean isRbcEvent =
|
||||||
|
mLastBrightnessEvent.isRbcEnabled() != mTempBrightnessEvent.isRbcEnabled();
|
||||||
|
|
||||||
if ((!mTempBrightnessEvent.equalsMainData(mLastBrightnessEvent) && !tempToTempTransition)
|
if ((!mTempBrightnessEvent.equalsMainData(mLastBrightnessEvent) && !tempToTempTransition)
|
||||||
|| brightnessAdjustmentFlags != 0) {
|
|| brightnessAdjustmentFlags != 0) {
|
||||||
mTempBrightnessEvent.setInitialBrightness(mLastBrightnessEvent.getBrightness());
|
mTempBrightnessEvent.setInitialBrightness(mLastBrightnessEvent.getBrightness());
|
||||||
@@ -1612,6 +1621,10 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
|
|||||||
if (mBrightnessEventRingBuffer != null) {
|
if (mBrightnessEventRingBuffer != null) {
|
||||||
mBrightnessEventRingBuffer.append(newEvent);
|
mBrightnessEventRingBuffer.append(newEvent);
|
||||||
}
|
}
|
||||||
|
if (isRbcEvent) {
|
||||||
|
mRbcEventRingBuffer.append(newEvent);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update display white-balance.
|
// Update display white-balance.
|
||||||
@@ -2359,6 +2372,8 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
|
|||||||
dumpBrightnessEvents(pw);
|
dumpBrightnessEvents(pw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dumpRbcEvents(pw);
|
||||||
|
|
||||||
if (mHbmController != null) {
|
if (mHbmController != null) {
|
||||||
mHbmController.dump(pw);
|
mHbmController.dump(pw);
|
||||||
}
|
}
|
||||||
@@ -2431,6 +2446,20 @@ final class DisplayPowerController2 implements AutomaticBrightnessController.Cal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dumpRbcEvents(PrintWriter pw) {
|
||||||
|
int size = mRbcEventRingBuffer.size();
|
||||||
|
if (size < 1) {
|
||||||
|
pw.println("No Reduce Bright Colors Adjustments");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pw.println("Reduce Bright Colors Adjustments Last " + size + " Events: ");
|
||||||
|
BrightnessEvent[] eventArray = mRbcEventRingBuffer.toArray();
|
||||||
|
for (int i = 0; i < mRbcEventRingBuffer.size(); i++) {
|
||||||
|
pw.println(" " + eventArray[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void noteScreenState(int screenState) {
|
private void noteScreenState(int screenState) {
|
||||||
// Log screen state change with display id
|
// Log screen state change with display id
|
||||||
|
|||||||
Reference in New Issue
Block a user