Remove Windowing Prototype 1 from Codebase
Refactor codebase to remove desktop windowing Proto1 as it is no longer supported in favor of proto2. (https://docs.google.com/document/d/1bWix49k1XmI97I1AgWEbvQKSD-PuKyJIyYdvb9PYJKk/edit) Test: aTest WMShellUnitTests Bug: 297217817 Change-Id: Ie864810a6842cea4a98520b48e74dffbdbd7da1c
This commit is contained in:
@@ -511,77 +511,4 @@ public abstract class DevelopmentTiles extends TileService {
|
||||
Settings.System.SHOW_TOUCHES, isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tile to enable desktop mode
|
||||
*/
|
||||
public static class DesktopMode extends DevelopmentTiles {
|
||||
|
||||
private static final int SETTING_VALUE_ON = 1;
|
||||
private static final int SETTING_VALUE_OFF = 0;
|
||||
private Context mContext;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mContext = getApplicationContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEnabled() {
|
||||
return Settings.System.getInt(mContext.getContentResolver(),
|
||||
Settings.System.DESKTOP_MODE, SETTING_VALUE_OFF) == SETTING_VALUE_ON;
|
||||
}
|
||||
|
||||
private boolean isDesktopModeFlagEnabled() {
|
||||
return SystemProperties.getBoolean("persist.wm.debug.desktop_mode", false);
|
||||
}
|
||||
|
||||
private boolean isFreeformFlagEnabled() {
|
||||
return Settings.Global.getInt(mContext.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, SETTING_VALUE_OFF)
|
||||
== SETTING_VALUE_ON;
|
||||
}
|
||||
|
||||
private boolean isCaptionOnShellEnabled() {
|
||||
return SystemProperties.getBoolean("persist.wm.debug.caption_on_shell", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setIsEnabled(boolean isEnabled) {
|
||||
if (isEnabled) {
|
||||
// Check that all required features are enabled
|
||||
if (!isDesktopModeFlagEnabled()) {
|
||||
closeShade();
|
||||
showMessage(
|
||||
"Enable 'Desktop Windowing Proto 1' from the Flag Flipper app");
|
||||
return;
|
||||
}
|
||||
if (!isCaptionOnShellEnabled()) {
|
||||
closeShade();
|
||||
showMessage("Enable 'Captions in Shell' from the Flag Flipper app");
|
||||
return;
|
||||
}
|
||||
if (!isFreeformFlagEnabled()) {
|
||||
closeShade();
|
||||
showMessage(
|
||||
"Enable freeform windows from developer settings");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Settings.System.putInt(mContext.getContentResolver(),
|
||||
Settings.System.DESKTOP_MODE,
|
||||
isEnabled ? SETTING_VALUE_ON : SETTING_VALUE_OFF);
|
||||
closeShade();
|
||||
}
|
||||
|
||||
private void closeShade() {
|
||||
sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
|
||||
}
|
||||
|
||||
private void showMessage(String message) {
|
||||
Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user