Revert "Reduce display device log spam." DO NOT MERGE ANYWHERE
This CL didn't ship with diamond-release, but will make diamond-mr1.
This reverts commit 80fa3fa027.
Change-Id: I1b037b6ac6a504235463a36a5dcd152b6a1434f3
This commit is contained in:
@@ -47,10 +47,6 @@ abstract class DisplayDevice {
|
|||||||
// within a transaction from performTraversalInTransactionLocked.
|
// within a transaction from performTraversalInTransactionLocked.
|
||||||
private Surface mCurrentSurface;
|
private Surface mCurrentSurface;
|
||||||
|
|
||||||
// DEBUG STATE: Last device info which was written to the log, or null if none.
|
|
||||||
// Do not use for any other purpose.
|
|
||||||
DisplayDeviceInfo mDebugLastLoggedDeviceInfo;
|
|
||||||
|
|
||||||
public DisplayDevice(DisplayAdapter displayAdapter, IBinder displayToken, String uniqueId) {
|
public DisplayDevice(DisplayAdapter displayAdapter, IBinder displayToken, String uniqueId) {
|
||||||
mDisplayAdapter = displayAdapter;
|
mDisplayAdapter = displayAdapter;
|
||||||
mDisplayToken = displayToken;
|
mDisplayToken = displayToken;
|
||||||
|
|||||||
@@ -103,16 +103,6 @@ final class DisplayDeviceInfo {
|
|||||||
*/
|
*/
|
||||||
public static final int TOUCH_EXTERNAL = 2;
|
public static final int TOUCH_EXTERNAL = 2;
|
||||||
|
|
||||||
/**
|
|
||||||
* Diff result: The {@link #state} fields differ.
|
|
||||||
*/
|
|
||||||
public static final int DIFF_STATE = 1 << 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Diff result: Other fields differ.
|
|
||||||
*/
|
|
||||||
public static final int DIFF_OTHER = 1 << 1;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the name of the display device, which may be derived from EDID or
|
* Gets the name of the display device, which may be derived from EDID or
|
||||||
* other sources. The name may be localized and displayed to the user.
|
* other sources. The name may be localized and displayed to the user.
|
||||||
@@ -248,39 +238,26 @@ final class DisplayDeviceInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean equals(DisplayDeviceInfo other) {
|
public boolean equals(DisplayDeviceInfo other) {
|
||||||
return other != null && diff(other) == 0;
|
return other != null
|
||||||
}
|
&& Objects.equal(name, other.name)
|
||||||
|
&& Objects.equal(uniqueId, other.uniqueId)
|
||||||
/**
|
&& width == other.width
|
||||||
* Computes the difference between display device infos.
|
&& height == other.height
|
||||||
* Assumes other is not null.
|
&& refreshRate == other.refreshRate
|
||||||
*/
|
&& Arrays.equals(supportedRefreshRates, other.supportedRefreshRates)
|
||||||
public int diff(DisplayDeviceInfo other) {
|
&& densityDpi == other.densityDpi
|
||||||
int diff = 0;
|
&& xDpi == other.xDpi
|
||||||
if (state != other.state) {
|
&& yDpi == other.yDpi
|
||||||
diff |= DIFF_STATE;
|
&& appVsyncOffsetNanos == other.appVsyncOffsetNanos
|
||||||
}
|
&& presentationDeadlineNanos == other.presentationDeadlineNanos
|
||||||
if (!Objects.equal(name, other.name)
|
&& flags == other.flags
|
||||||
|| !Objects.equal(uniqueId, other.uniqueId)
|
&& touch == other.touch
|
||||||
|| width != other.width
|
&& rotation == other.rotation
|
||||||
|| height != other.height
|
&& type == other.type
|
||||||
|| refreshRate != other.refreshRate
|
&& Objects.equal(address, other.address)
|
||||||
|| !Arrays.equals(supportedRefreshRates, other.supportedRefreshRates)
|
&& state == other.state
|
||||||
|| densityDpi != other.densityDpi
|
&& ownerUid == other.ownerUid
|
||||||
|| xDpi != other.xDpi
|
&& Objects.equal(ownerPackageName, other.ownerPackageName);
|
||||||
|| yDpi != other.yDpi
|
|
||||||
|| appVsyncOffsetNanos != other.appVsyncOffsetNanos
|
|
||||||
|| presentationDeadlineNanos != other.presentationDeadlineNanos
|
|
||||||
|| flags != other.flags
|
|
||||||
|| touch != other.touch
|
|
||||||
|| rotation != other.rotation
|
|
||||||
|| type != other.type
|
|
||||||
|| !Objects.equal(address, other.address)
|
|
||||||
|| ownerUid != other.ownerUid
|
|
||||||
|| !Objects.equal(ownerPackageName, other.ownerPackageName)) {
|
|
||||||
diff |= DIFF_OTHER;
|
|
||||||
}
|
|
||||||
return diff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -640,14 +640,13 @@ public final class DisplayManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleDisplayDeviceAddedLocked(DisplayDevice device) {
|
private void handleDisplayDeviceAddedLocked(DisplayDevice device) {
|
||||||
DisplayDeviceInfo info = device.getDisplayDeviceInfoLocked();
|
|
||||||
if (mDisplayDevices.contains(device)) {
|
if (mDisplayDevices.contains(device)) {
|
||||||
Slog.w(TAG, "Attempted to add already added display device: " + info);
|
Slog.w(TAG, "Attempted to add already added display device: "
|
||||||
|
+ device.getDisplayDeviceInfoLocked());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Slog.i(TAG, "Display device added: " + info);
|
Slog.i(TAG, "Display device added: " + device.getDisplayDeviceInfoLocked());
|
||||||
device.mDebugLastLoggedDeviceInfo = info;
|
|
||||||
|
|
||||||
mDisplayDevices.add(device);
|
mDisplayDevices.add(device);
|
||||||
addLogicalDisplayLocked(device);
|
addLogicalDisplayLocked(device);
|
||||||
@@ -660,20 +659,13 @@ public final class DisplayManagerService extends SystemService {
|
|||||||
|
|
||||||
private void handleDisplayDeviceChanged(DisplayDevice device) {
|
private void handleDisplayDeviceChanged(DisplayDevice device) {
|
||||||
synchronized (mSyncRoot) {
|
synchronized (mSyncRoot) {
|
||||||
DisplayDeviceInfo info = device.getDisplayDeviceInfoLocked();
|
|
||||||
if (!mDisplayDevices.contains(device)) {
|
if (!mDisplayDevices.contains(device)) {
|
||||||
Slog.w(TAG, "Attempted to change non-existent display device: " + info);
|
Slog.w(TAG, "Attempted to change non-existent display device: "
|
||||||
|
+ device.getDisplayDeviceInfoLocked());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int diff = device.mDebugLastLoggedDeviceInfo.diff(info);
|
Slog.i(TAG, "Display device changed: " + device.getDisplayDeviceInfoLocked());
|
||||||
if (diff == DisplayDeviceInfo.DIFF_STATE) {
|
|
||||||
Slog.i(TAG, "Display device changed state: \"" + info.name
|
|
||||||
+ "\", " + Display.stateToString(info.state));
|
|
||||||
} else if (diff != 0) {
|
|
||||||
Slog.i(TAG, "Display device changed: " + info);
|
|
||||||
}
|
|
||||||
device.mDebugLastLoggedDeviceInfo = info;
|
|
||||||
|
|
||||||
device.applyPendingDisplayDeviceInfoChangesLocked();
|
device.applyPendingDisplayDeviceInfoChangesLocked();
|
||||||
if (updateLogicalDisplaysLocked()) {
|
if (updateLogicalDisplaysLocked()) {
|
||||||
@@ -688,14 +680,13 @@ public final class DisplayManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void handleDisplayDeviceRemovedLocked(DisplayDevice device) {
|
private void handleDisplayDeviceRemovedLocked(DisplayDevice device) {
|
||||||
DisplayDeviceInfo info = device.getDisplayDeviceInfoLocked();
|
|
||||||
if (!mDisplayDevices.remove(device)) {
|
if (!mDisplayDevices.remove(device)) {
|
||||||
Slog.w(TAG, "Attempted to remove non-existent display device: " + info);
|
Slog.w(TAG, "Attempted to remove non-existent display device: "
|
||||||
|
+ device.getDisplayDeviceInfoLocked());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Slog.i(TAG, "Display device removed: " + info);
|
Slog.i(TAG, "Display device removed: " + device.getDisplayDeviceInfoLocked());
|
||||||
device.mDebugLastLoggedDeviceInfo = info;
|
|
||||||
|
|
||||||
updateLogicalDisplaysLocked();
|
updateLogicalDisplaysLocked();
|
||||||
scheduleTraversalLocked(false);
|
scheduleTraversalLocked(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user