Loading quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +0 −18 Original line number Diff line number Diff line Loading @@ -15,9 +15,6 @@ */ 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 @@ -46,7 +43,6 @@ 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 @@ -653,20 +649,6 @@ 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 +3 −34 Original line number Diff line number Diff line Loading @@ -15,11 +15,6 @@ */ 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; import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_PRE_DELAY; Loading Loading @@ -112,8 +107,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { private @Nullable TaskbarManager mTaskbarManager; private @Nullable FallbackTaskbarUIController mTaskbarUIController; private Configuration mOldConfig; private StateManager<RecentsState> mStateManager; // Strong refs to runners which are cleared when the activity is destroyed Loading Loading @@ -165,7 +158,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { @Override public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) { onHandleConfigChanged(); onHandleConfigurationChanged(); super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig); } Loading @@ -175,11 +168,8 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { ACTIVITY_TRACKER.handleNewIntent(this); } /** * Logic for when device configuration changes (rotation, screen size change, multi-window, * etc.) */ protected void onHandleConfigChanged() { @Override protected void onHandleConfigurationChanged() { initDeviceProfile(); AbstractFloatingView.closeOpenViews(this, true, Loading Loading @@ -340,7 +330,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { mStateManager = new StateManager<>(this, RecentsState.BG_LAUNCHER); mOldConfig = new Configuration(getResources().getConfiguration()); initDeviceProfile(); setupViews(); Loading @@ -349,26 +338,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { ACTIVITY_TRACKER.handleCreate(this); } @Override public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onHandleConfigChanged(); } mOldConfig.setTo(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 public void onStateSetEnd(RecentsState state) { super.onStateSetEnd(state); Loading src/com/android/launcher3/Launcher.java +5 −20 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ package com.android.launcher3; import static android.app.PendingIntent.FLAG_IMMUTABLE; import static android.app.PendingIntent.FLAG_UPDATE_CURRENT; import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; import static android.content.pm.ActivityInfo.CONFIG_UI_MODE; import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED; Loading Loading @@ -310,8 +308,6 @@ public class Launcher extends StatefulActivity<LauncherState> private static final FloatProperty<Hotseat> HOTSEAT_WIDGET_SCALE = HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WIDGET_TRANSITION); private Configuration mOldConfig; @Thunk Workspace<?> mWorkspace; @Thunk Loading Loading @@ -466,7 +462,6 @@ public class Launcher extends StatefulActivity<LauncherState> super.onCreate(savedInstanceState); LauncherAppState app = LauncherAppState.getInstance(this); mOldConfig = new Configuration(getResources().getConfiguration()); mModel = app.getModel(); mRotationHelper = new RotationHelper(this); Loading Loading @@ -614,21 +609,6 @@ public class Launcher extends StatefulActivity<LauncherState> dispatchDeviceProfileChanged(); } @Override public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onIdpChanged(false); } mOldConfig.setTo(newConfig); super.handleConfigurationChanged(newConfig); } protected boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); return (diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0; } /** * Initializes the drag controller. */ Loading @@ -638,6 +618,11 @@ public class Launcher extends StatefulActivity<LauncherState> @Override public void onIdpChanged(boolean modelPropertiesChanged) { onHandleConfigurationChanged(); } @Override protected void onHandleConfigurationChanged() { if (!initDeviceProfile(mDeviceProfile.inv)) { return; } Loading src/com/android/launcher3/statemanager/StatefulActivity.java +33 −1 Original line number Diff line number Diff line Loading @@ -15,10 +15,14 @@ */ package com.android.launcher3.statemanager; import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; 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.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; Loading @@ -31,6 +35,7 @@ import com.android.launcher3.LauncherRootView; import com.android.launcher3.Utilities; import com.android.launcher3.statemanager.StateManager.AtomicAnimationFactory; import com.android.launcher3.statemanager.StateManager.StateHandler; import com.android.launcher3.util.window.WindowManagerProxy; import com.android.launcher3.views.BaseDragLayer; import java.util.List; Loading @@ -48,6 +53,17 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>> private LauncherRootView mRootView; protected Configuration mOldConfig; private int mOldRotation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mOldConfig = new Configuration(getResources().getConfiguration()); mOldRotation = WindowManagerProxy.INSTANCE.get(this).getRotation(this); } /** * Create handlers to control the property changes for this activity */ Loading Loading @@ -198,5 +214,21 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>> * Handles configuration change when system calls {@link #onConfigurationChanged}, or on other * situations that configuration might change. */ public void handleConfigurationChanged(Configuration newConfig) {} public void handleConfigurationChanged(Configuration newConfig) { int diff = newConfig.diff(mOldConfig); int rotation = WindowManagerProxy.INSTANCE.get(this).getRotation(this); if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0 || rotation != mOldRotation) { onHandleConfigurationChanged(); } mOldConfig.setTo(newConfig); mOldRotation = rotation; } /** * Logic for when device configuration changes (rotation, screen size change, multi-window, * etc.) */ protected abstract void onHandleConfigurationChanged(); } Loading
quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +0 −18 Original line number Diff line number Diff line Loading @@ -15,9 +15,6 @@ */ 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 @@ -46,7 +43,6 @@ 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 @@ -653,20 +649,6 @@ 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 +3 −34 Original line number Diff line number Diff line Loading @@ -15,11 +15,6 @@ */ 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; import static com.android.launcher3.QuickstepTransitionManager.STATUS_BAR_TRANSITION_PRE_DELAY; Loading Loading @@ -112,8 +107,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { private @Nullable TaskbarManager mTaskbarManager; private @Nullable FallbackTaskbarUIController mTaskbarUIController; private Configuration mOldConfig; private StateManager<RecentsState> mStateManager; // Strong refs to runners which are cleared when the activity is destroyed Loading Loading @@ -165,7 +158,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { @Override public void onMultiWindowModeChanged(boolean isInMultiWindowMode, Configuration newConfig) { onHandleConfigChanged(); onHandleConfigurationChanged(); super.onMultiWindowModeChanged(isInMultiWindowMode, newConfig); } Loading @@ -175,11 +168,8 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { ACTIVITY_TRACKER.handleNewIntent(this); } /** * Logic for when device configuration changes (rotation, screen size change, multi-window, * etc.) */ protected void onHandleConfigChanged() { @Override protected void onHandleConfigurationChanged() { initDeviceProfile(); AbstractFloatingView.closeOpenViews(this, true, Loading Loading @@ -340,7 +330,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { mStateManager = new StateManager<>(this, RecentsState.BG_LAUNCHER); mOldConfig = new Configuration(getResources().getConfiguration()); initDeviceProfile(); setupViews(); Loading @@ -349,26 +338,6 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> { ACTIVITY_TRACKER.handleCreate(this); } @Override public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onHandleConfigChanged(); } mOldConfig.setTo(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 public void onStateSetEnd(RecentsState state) { super.onStateSetEnd(state); Loading
src/com/android/launcher3/Launcher.java +5 −20 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ package com.android.launcher3; import static android.app.PendingIntent.FLAG_IMMUTABLE; import static android.app.PendingIntent.FLAG_UPDATE_CURRENT; import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; import static android.content.pm.ActivityInfo.CONFIG_UI_MODE; import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO; import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED; Loading Loading @@ -310,8 +308,6 @@ public class Launcher extends StatefulActivity<LauncherState> private static final FloatProperty<Hotseat> HOTSEAT_WIDGET_SCALE = HOTSEAT_SCALE_PROPERTY_FACTORY.get(SCALE_INDEX_WIDGET_TRANSITION); private Configuration mOldConfig; @Thunk Workspace<?> mWorkspace; @Thunk Loading Loading @@ -466,7 +462,6 @@ public class Launcher extends StatefulActivity<LauncherState> super.onCreate(savedInstanceState); LauncherAppState app = LauncherAppState.getInstance(this); mOldConfig = new Configuration(getResources().getConfiguration()); mModel = app.getModel(); mRotationHelper = new RotationHelper(this); Loading Loading @@ -614,21 +609,6 @@ public class Launcher extends StatefulActivity<LauncherState> dispatchDeviceProfileChanged(); } @Override public void handleConfigurationChanged(Configuration newConfig) { if (compareConfiguration(mOldConfig, newConfig)) { onIdpChanged(false); } mOldConfig.setTo(newConfig); super.handleConfigurationChanged(newConfig); } protected boolean compareConfiguration(Configuration oldConfig, Configuration newConfig) { int diff = newConfig.diff(oldConfig); return (diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0; } /** * Initializes the drag controller. */ Loading @@ -638,6 +618,11 @@ public class Launcher extends StatefulActivity<LauncherState> @Override public void onIdpChanged(boolean modelPropertiesChanged) { onHandleConfigurationChanged(); } @Override protected void onHandleConfigurationChanged() { if (!initDeviceProfile(mDeviceProfile.inv)) { return; } Loading
src/com/android/launcher3/statemanager/StatefulActivity.java +33 −1 Original line number Diff line number Diff line Loading @@ -15,10 +15,14 @@ */ package com.android.launcher3.statemanager; import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; 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.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; Loading @@ -31,6 +35,7 @@ import com.android.launcher3.LauncherRootView; import com.android.launcher3.Utilities; import com.android.launcher3.statemanager.StateManager.AtomicAnimationFactory; import com.android.launcher3.statemanager.StateManager.StateHandler; import com.android.launcher3.util.window.WindowManagerProxy; import com.android.launcher3.views.BaseDragLayer; import java.util.List; Loading @@ -48,6 +53,17 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>> private LauncherRootView mRootView; protected Configuration mOldConfig; private int mOldRotation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mOldConfig = new Configuration(getResources().getConfiguration()); mOldRotation = WindowManagerProxy.INSTANCE.get(this).getRotation(this); } /** * Create handlers to control the property changes for this activity */ Loading Loading @@ -198,5 +214,21 @@ public abstract class StatefulActivity<STATE_TYPE extends BaseState<STATE_TYPE>> * Handles configuration change when system calls {@link #onConfigurationChanged}, or on other * situations that configuration might change. */ public void handleConfigurationChanged(Configuration newConfig) {} public void handleConfigurationChanged(Configuration newConfig) { int diff = newConfig.diff(mOldConfig); int rotation = WindowManagerProxy.INSTANCE.get(this).getRotation(this); if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0 || rotation != mOldRotation) { onHandleConfigurationChanged(); } mOldConfig.setTo(newConfig); mOldRotation = rotation; } /** * Logic for when device configuration changes (rotation, screen size change, multi-window, * etc.) */ protected abstract void onHandleConfigurationChanged(); }