Merge "Removing checks from EnableWifiTether which are done in SystemUI" into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fc988c03e1
@@ -352,7 +352,7 @@
|
|||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".EnableWifiTether"
|
<activity android:name=".EnableWifiTether"
|
||||||
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
|
android:theme="@style/Transparent"
|
||||||
android:excludeFromRecents="true" />
|
android:excludeFromRecents="true" />
|
||||||
|
|
||||||
<activity android:name="Settings$TetherSettingsActivity"
|
<activity android:name="Settings$TetherSettingsActivity"
|
||||||
|
@@ -38,31 +38,16 @@ public class EnableWifiTether extends Activity {
|
|||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
mProvisionApp = getResources().getStringArray(
|
mProvisionApp = getResources().getStringArray(
|
||||||
com.android.internal.R.array.config_mobile_hotspot_provision_app);
|
com.android.internal.R.array.config_mobile_hotspot_provision_app);
|
||||||
setContentView(R.layout.settings_main_dashboard);
|
startProvisioning();
|
||||||
startProvisioningIfNecessary();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isProvisioningNeeded(String[] provisionApp) {
|
private void startProvisioning() {
|
||||||
if (SystemProperties.getBoolean("net.tethering.noprovisioning", false)
|
|
||||||
|| provisionApp == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (provisionApp.length == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startProvisioningIfNecessary() {
|
|
||||||
|
|
||||||
if (isProvisioningNeeded(mProvisionApp)) {
|
|
||||||
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
||||||
sendBroadcast(closeDialog);
|
sendBroadcast(closeDialog);
|
||||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||||
intent.setClassName(mProvisionApp[0], mProvisionApp[1]);
|
intent.setClassName(mProvisionApp[0], mProvisionApp[1]);
|
||||||
intent.putExtra(TETHER_CHOICE, WIFI_TETHERING);
|
intent.putExtra(TETHER_CHOICE, WIFI_TETHERING);
|
||||||
startActivityForResult(intent, PROVISION_REQUEST);
|
startActivityForResult(intent, PROVISION_REQUEST);
|
||||||
} else {
|
|
||||||
enableTethering();
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
||||||
@@ -72,9 +57,9 @@ public class EnableWifiTether extends Activity {
|
|||||||
if (resultCode == Activity.RESULT_OK) {
|
if (resultCode == Activity.RESULT_OK) {
|
||||||
enableTethering();
|
enableTethering();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void enableTethering() {
|
private void enableTethering() {
|
||||||
final ContentResolver cr = getContentResolver();
|
final ContentResolver cr = getContentResolver();
|
||||||
|
Reference in New Issue
Block a user