diff options
author | Roman Kiryanov <rkir@google.com> | 2024-04-25 04:18:30 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-04-25 04:18:30 +0000 |
commit | 6164a56b3cbcaf151905fa5b96ea05c1f361724f (patch) | |
tree | c45a8d77daadf83d9b80535a82dc85599200d72b | |
parent | 13a4c86d116c907c23b99774c06134dd9742eef9 (diff) | |
parent | f1e65147195c883d72009255fa89b7a721d330fb (diff) | |
download | goldfish-6164a56b3cbcaf151905fa5b96ea05c1f361724f.tar.gz |
Merge "Retire the SettingsProvider overlay" into main
-rw-r--r-- | overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml | 32 | ||||
-rw-r--r-- | provision/EmulatorProvisonLib/src/com/android/sdksetup/ProvisionActivity.java | 9 |
2 files changed, 8 insertions, 33 deletions
diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml deleted file mode 100644 index 7b206e46..00000000 --- a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- -/** - * Copyright (c) 2015, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ ---> - -<resources> - <bool name="def_lockscreen_disabled">true</bool> - <bool name="def_wifi_on">true</bool> - <!-- Allow scanning even if WiFi is disabled --> - <integer name="def_wifi_scan_always_available">1</integer> - - <!-- maximize the timeout to INT_MAX about 500+ hours --> - <integer name="def_screen_off_timeout">2147483647</integer> - - <!-- Allow users to use both the on-screen keyboard, as well as a real - keyboard --> - <bool name="def_show_ime_with_hard_keyboard">true</bool> -</resources> diff --git a/provision/EmulatorProvisonLib/src/com/android/sdksetup/ProvisionActivity.java b/provision/EmulatorProvisonLib/src/com/android/sdksetup/ProvisionActivity.java index 8ba2c913..8ce1fff5 100644 --- a/provision/EmulatorProvisonLib/src/com/android/sdksetup/ProvisionActivity.java +++ b/provision/EmulatorProvisonLib/src/com/android/sdksetup/ProvisionActivity.java @@ -97,6 +97,12 @@ public abstract class ProvisionActivity extends Activity { protected void provisionWifi(final String ssid) { Settings.Global.putInt(getContentResolver(), Settings.Global.TETHER_OFFLOAD_DISABLED, 1); + final WifiManager mWifiManager = getApplicationContext().getSystemService(WifiManager.class); + if (!mWifiManager.setWifiEnabled(true)) { + Log.e(TAG(), "Unable to turn on Wi-Fi"); + return; + } + final int ADD_NETWORK_FAIL = -1; final String quotedSsid = "\"" + ssid + "\""; @@ -104,7 +110,6 @@ public abstract class ProvisionActivity extends Activity { config.SSID = quotedSsid; config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN); - final WifiManager mWifiManager = getApplicationContext().getSystemService(WifiManager.class); final int netId = mWifiManager.addNetwork(config); if (netId == ADD_NETWORK_FAIL || !mWifiManager.enableNetwork(netId, true)) { @@ -114,6 +119,8 @@ public abstract class ProvisionActivity extends Activity { // Set physical keyboard layout based on the system property set by emulator host. protected void provisionKeyboard(final String deviceName) { + Settings.Secure.putInt(getContentResolver(), Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD, 1); + final String layoutName = SystemProperties.get("vendor.qemu.keyboard_layout"); final InputDevice device = getKeyboardDevice(deviceName); if (device != null && !layoutName.isEmpty()) { |