Merge "[SdkSetup] Clean up"
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<application>
|
||||
<activity android:name="DefaultActivity"
|
||||
android:excludeFromRecents="true">
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true">
|
||||
<intent-filter android:priority="3">
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -48,6 +48,16 @@ public class DefaultActivity extends Activity {
|
||||
|
||||
// Edit Settings only for 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.
|
||||
String layoutName = SystemProperties.get("vendor.qemu.keyboard_layout");
|
||||
String deviceName = "qwerty2";
|
||||
@@ -80,15 +90,6 @@ public class DefaultActivity extends Activity {
|
||||
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.
|
||||
PackageManager pm = getPackageManager();
|
||||
ComponentName name = new ComponentName(this, DefaultActivity.class);
|
||||
|
||||
Reference in New Issue
Block a user