Loading quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +18 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ */ package com.android.launcher3; import static android.app.WindowConfiguration.WINDOW_CONFIG_ROTATION; import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON; import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON; Loading Loading @@ -43,6 +46,7 @@ import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; import android.content.IntentSender; import android.content.res.Configuration; import android.hardware.SensorManager; import android.hardware.devicestate.DeviceStateManager; import android.os.Bundle; Loading Loading @@ -649,6 +653,20 @@ public abstract class BaseQuickstepLauncher extends Launcher { } } @Override protected boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); if ((diff & CONFIG_WINDOW_CONFIGURATION) != 0) { long windowDiff = newConfig.windowConfiguration.diff(oldConfig.windowConfiguration, false); if ((windowDiff & WINDOW_CONFIG_ROTATION) != 0) { return true; } } return super.compareConfiguration(oldConfig, newConfig); } @Override public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { super.dump(prefix, fd, writer, args); Loading quickstep/src/com/android/quickstep/RecentsActivity.java +16 −4 Original line number Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ package com.android.quickstep; import static android.app.WindowConfiguration.WINDOW_CONFIG_ROTATION; import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION; import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION; import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_DURATION; Loading Loading @@ -348,13 +350,23 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { } @Override public void onConfigurationChanged(Configuration newConfig) { int diff = newConfig.diff(mOldConfig); if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) { public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onHandleConfigChanged(); } mOldConfig.setTo(newConfig); super.onConfigurationChanged(newConfig); super.handleConfigurationChanged(newConfig); } private boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); if ((diff & CONFIG_WINDOW_CONFIGURATION) != 0) { long windowDiff = newConfig.windowConfiguration.diff(oldConfig.windowConfiguration, false); return (windowDiff & WINDOW_CONFIG_ROTATION) != 0; } return (diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0; } @Override Loading src/com/android/launcher3/Launcher.java +8 −4 Original line number Diff line number Diff line Loading @@ -615,14 +615,18 @@ public class Launcher extends StatefulActivity<LauncherState> } @Override public void onConfigurationChanged(Configuration newConfig) { int diff = newConfig.diff(mOldConfig); if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) { public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onIdpChanged(false); } mOldConfig.setTo(newConfig); super.onConfigurationChanged(newConfig); super.handleConfigurationChanged(newConfig); } protected boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); return (diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0; } /** Loading src/com/android/launcher3/LauncherRootView.java +2 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ public class LauncherRootView extends InsettableFrameLayout { @Override public WindowInsets onApplyWindowInsets(WindowInsets insets) { mActivity.handleConfigurationChanged(mActivity.getResources().getConfiguration()); insets = WindowManagerProxy.INSTANCE.get(getContext()) .normalizeWindowInsets(getContext(), insets, mTempRect); handleSystemWindowInsets(mTempRect); Loading src/com/android/launcher3/statemanager/StatefulActivity.java +13 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.statemanager; import static com.android.launcher3.LauncherState.FLAG_CLOSE_POPUPS; import static com.android.launcher3.LauncherState.FLAG_NON_INTERACTIVE; import android.content.res.Configuration; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; Loading Loading @@ -186,4 +187,16 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>> public void runOnBindToTouchInteractionService(Runnable r) { r.run(); } @Override public void onConfigurationChanged(Configuration newConfig) { handleConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); } /** * Handles configuration change when system calls {@link #onConfigurationChanged}, or on other * situations that configuration might change. */ public void handleConfigurationChanged(Configuration newConfig) {} } Loading
quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +18 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,9 @@ */ package com.android.launcher3; import static android.app.WindowConfiguration.WINDOW_CONFIG_ROTATION; import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION; import static com.android.launcher3.AbstractFloatingView.TYPE_ALL; import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON; import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON; Loading Loading @@ -43,6 +46,7 @@ import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; import android.content.IntentSender; import android.content.res.Configuration; import android.hardware.SensorManager; import android.hardware.devicestate.DeviceStateManager; import android.os.Bundle; Loading Loading @@ -649,6 +653,20 @@ public abstract class BaseQuickstepLauncher extends Launcher { } } @Override protected boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); if ((diff & CONFIG_WINDOW_CONFIGURATION) != 0) { long windowDiff = newConfig.windowConfiguration.diff(oldConfig.windowConfiguration, false); if ((windowDiff & WINDOW_CONFIG_ROTATION) != 0) { return true; } } return super.compareConfiguration(oldConfig, newConfig); } @Override public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) { super.dump(prefix, fd, writer, args); Loading
quickstep/src/com/android/quickstep/RecentsActivity.java +16 −4 Original line number Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ package com.android.quickstep; import static android.app.WindowConfiguration.WINDOW_CONFIG_ROTATION; import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; import static android.content.pm.ActivityInfo.CONFIG_WINDOW_CONFIGURATION; import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION; import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_DURATION; Loading Loading @@ -348,13 +350,23 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { } @Override public void onConfigurationChanged(Configuration newConfig) { int diff = newConfig.diff(mOldConfig); if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) { public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onHandleConfigChanged(); } mOldConfig.setTo(newConfig); super.onConfigurationChanged(newConfig); super.handleConfigurationChanged(newConfig); } private boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); if ((diff & CONFIG_WINDOW_CONFIGURATION) != 0) { long windowDiff = newConfig.windowConfiguration.diff(oldConfig.windowConfiguration, false); return (windowDiff & WINDOW_CONFIG_ROTATION) != 0; } return (diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0; } @Override Loading
src/com/android/launcher3/Launcher.java +8 −4 Original line number Diff line number Diff line Loading @@ -615,14 +615,18 @@ public class Launcher extends StatefulActivity<LauncherState> } @Override public void onConfigurationChanged(Configuration newConfig) { int diff = newConfig.diff(mOldConfig); if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) { public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onIdpChanged(false); } mOldConfig.setTo(newConfig); super.onConfigurationChanged(newConfig); super.handleConfigurationChanged(newConfig); } protected boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); return (diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0; } /** Loading
src/com/android/launcher3/LauncherRootView.java +2 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,8 @@ public class LauncherRootView extends InsettableFrameLayout { @Override public WindowInsets onApplyWindowInsets(WindowInsets insets) { mActivity.handleConfigurationChanged(mActivity.getResources().getConfiguration()); insets = WindowManagerProxy.INSTANCE.get(getContext()) .normalizeWindowInsets(getContext(), insets, mTempRect); handleSystemWindowInsets(mTempRect); Loading
src/com/android/launcher3/statemanager/StatefulActivity.java +13 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.launcher3.statemanager; import static com.android.launcher3.LauncherState.FLAG_CLOSE_POPUPS; import static com.android.launcher3.LauncherState.FLAG_NON_INTERACTIVE; import android.content.res.Configuration; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; Loading Loading @@ -186,4 +187,16 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>> public void runOnBindToTouchInteractionService(Runnable r) { r.run(); } @Override public void onConfigurationChanged(Configuration newConfig) { handleConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig); } /** * Handles configuration change when system calls {@link #onConfigurationChanged}, or on other * situations that configuration might change. */ public void handleConfigurationChanged(Configuration newConfig) {} }