Logging config changes as well
Reduce some logging from previous CL
Bug: 185820525
Test: Presubmit
Change-Id: I69baed7b819b529db30a65cb39a80fb310d76243
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 27e2995..61023be 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -394,6 +394,9 @@
}
private void onConfigChanged(Context context) {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "IDP.onConfigChanged");
+ }
// Config changes, what shall we do?
InvariantDeviceProfile oldProfile = new InvariantDeviceProfile(this);
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 30dd548..a54c791 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -551,11 +551,16 @@
@Override
public void onConfigurationChanged(Configuration newConfig) {
int diff = newConfig.diff(mOldConfig);
-
if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) {
onIdpChanged(mDeviceProfile.inv);
}
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "onConfigurationChanged: diff=" + diff);
+ Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "newConfig=" + newConfig);
+ Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "oldConfig=" + mOldConfig);
+ }
+
mOldConfig.setTo(newConfig);
super.onConfigurationChanged(newConfig);
}
@@ -567,7 +572,7 @@
private void onIdpChanged(InvariantDeviceProfile idp) {
if (TestProtocol.sDebugTracing) {
- Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "onIdpChanged", new Throwable());
+ Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "onIdpChanged");
}
initDeviceProfile(idp);
dispatchDeviceProfileChanged();
diff --git a/src/com/android/launcher3/util/ConfigMonitor.java b/src/com/android/launcher3/util/ConfigMonitor.java
index b3b69f6..f7023e8 100644
--- a/src/com/android/launcher3/util/ConfigMonitor.java
+++ b/src/com/android/launcher3/util/ConfigMonitor.java
@@ -26,6 +26,7 @@
import android.graphics.Point;
import android.util.Log;
+import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.util.DisplayController.DisplayInfoChangeListener;
import com.android.launcher3.util.DisplayController.Info;
@@ -72,6 +73,10 @@
// Listen for configuration change
mContext.registerReceiver(this, new IntentFilter(Intent.ACTION_CONFIGURATION_CHANGED));
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "ConfigMonitor.register: this="
+ + System.identityHashCode(this) + " callback=" + callback.getClass().getName());
+ }
}
@Override
@@ -113,6 +118,10 @@
}
public void unregister() {
+ if (TestProtocol.sDebugTracing) {
+ Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "ConfigMonitor.unregister: this="
+ + System.identityHashCode(this));
+ }
try {
mContext.unregisterReceiver(this);
DisplayController.getDefaultDisplay(mContext).removeChangeListener(this);