diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index a863e6b55c..61023be019 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -394,6 +394,9 @@ public class InvariantDeviceProfile { } 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); @@ -578,7 +581,7 @@ public class InvariantDeviceProfile { public DeviceProfile getDeviceProfile(Context context) { if (TestProtocol.sDebugTracing) { Log.d(TestProtocol.LAUNCHER_NOT_TRANSPOSED, "getDeviceProfile: orientation=" - + context.getResources().getConfiguration().orientation, new Throwable()); + + context.getResources().getConfiguration().orientation); } return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE ? landscapeProfile : portraitProfile; diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 30dd5481d2..a54c791aff 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -551,11 +551,16 @@ public class Launcher extends StatefulActivity implements Launche @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 @@ public class Launcher extends StatefulActivity implements Launche 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 b3b69f6ab3..f7023e8f44 100644 --- a/src/com/android/launcher3/util/ConfigMonitor.java +++ b/src/com/android/launcher3/util/ConfigMonitor.java @@ -26,6 +26,7 @@ import android.content.res.Configuration; 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 @@ public class ConfigMonitor extends BroadcastReceiver implements DisplayInfoChang // 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 class ConfigMonitor extends BroadcastReceiver implements DisplayInfoChang } 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);