Merge "Sdksetup: Set path for display settings file for freeform display" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-04-26 17:42:38 +00:00
committed by Android (Google) Code Review

View File

@@ -50,6 +50,7 @@ public class DefaultActivity extends Activity {
if (Build.IS_EMULATOR) {
// Set physical keyboard layout based on the system property set by emulator host.
String layoutName = SystemProperties.get("vendor.qemu.keyboard_layout");
String displaySettingsName = SystemProperties.get("ro.boot.qemu.display.settings.xml");
String deviceName = "qwerty2";
InputDevice device = getKeyboardDevice(deviceName);
if (device != null && !layoutName.isEmpty()) {
@@ -78,6 +79,12 @@ public class DefaultActivity extends Activity {
TelephonyManager mTelephony = getApplicationContext().getSystemService(TelephonyManager.class);
mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR);
if ("freeform".equals(displaySettingsName)) {
Settings.Global.putInt(getContentResolver(), "sf", 1);
Settings.Global.putString(getContentResolver(), Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, "1");
Settings.Global.putString(getContentResolver(), Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES, "1");
Settings.Global.putString(getContentResolver(), Settings.Global.DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH, "vendor/etc/display_settings_freeform.xml");
}
}
// Add network with SSID "AndroidWifi"