Merge "Use WindowManagerProxy.getRotation to determine if rotation has changed" into tm-qpr-dev am: 5d9625b865 am: d86d6223b8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19582532 Change-Id: I93957f96b19647c873580ae014e275be2060b3f2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
ea521f4857
4 files changed
+41
-73
No files matched your search
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user