Merge "[SdkSetup] Clean up" am: 6105088a62
Original change: https://android-review.googlesource.com/c/platform/development/+/1752700 Change-Id: I678e89361a731633e57042527155e33225aa3818
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||||
<application>
|
<application>
|
||||||
<activity android:name="DefaultActivity"
|
<activity android:name="DefaultActivity"
|
||||||
android:excludeFromRecents="true">
|
android:excludeFromRecents="true"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="3">
|
<intent-filter android:priority="3">
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|||||||
@@ -48,6 +48,16 @@ public class DefaultActivity extends Activity {
|
|||||||
|
|
||||||
// Edit Settings only for Emulator
|
// Edit Settings only for Emulator
|
||||||
if (Build.IS_EMULATOR) {
|
if (Build.IS_EMULATOR) {
|
||||||
|
// Add network with SSID "AndroidWifi"
|
||||||
|
WifiConfiguration config = new WifiConfiguration();
|
||||||
|
config.SSID = "\"AndroidWifi\"";
|
||||||
|
config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
|
||||||
|
WifiManager mWifiManager = getApplicationContext().getSystemService(WifiManager.class);
|
||||||
|
int netId = mWifiManager.addNetwork(config);
|
||||||
|
if (netId == ADD_NETWORK_FAIL || mWifiManager.enableNetwork(netId, true)) {
|
||||||
|
Log.e(TAG, "Unable to add Wi-Fi network AndroidWifi.");
|
||||||
|
}
|
||||||
|
|
||||||
// Set physical keyboard layout based on the system property set by emulator host.
|
// Set physical keyboard layout based on the system property set by emulator host.
|
||||||
String layoutName = SystemProperties.get("vendor.qemu.keyboard_layout");
|
String layoutName = SystemProperties.get("vendor.qemu.keyboard_layout");
|
||||||
String deviceName = "qwerty2";
|
String deviceName = "qwerty2";
|
||||||
@@ -80,15 +90,6 @@ public class DefaultActivity extends Activity {
|
|||||||
mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR);
|
mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add network with SSID "AndroidWifi"
|
|
||||||
WifiConfiguration config = new WifiConfiguration();
|
|
||||||
config.SSID = "\"AndroidWifi\"";
|
|
||||||
config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
|
|
||||||
WifiManager mWifiManager = getApplicationContext().getSystemService(WifiManager.class);
|
|
||||||
int netId = mWifiManager.addNetwork(config);
|
|
||||||
if (netId == ADD_NETWORK_FAIL || mWifiManager.enableNetwork(netId, true)) {
|
|
||||||
Log.e(TAG, "Unable to add Wi-Fi network AndroidWifi.");
|
|
||||||
}
|
|
||||||
// remove this activity from the package manager.
|
// remove this activity from the package manager.
|
||||||
PackageManager pm = getPackageManager();
|
PackageManager pm = getPackageManager();
|
||||||
ComponentName name = new ComponentName(this, DefaultActivity.class);
|
ComponentName name = new ComponentName(this, DefaultActivity.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user