summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorSanket Padawe <sanketpadawe@google.com>2015-06-23 02:33:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-23 02:33:29 +0000
commit477d2ea4810dea406ffb285f778186e40e871018 (patch)
tree1e315f0048fdbfccc82c272f3abfde3f9091e8c9 /src/com/android
parent0694d5c4498466208bb21df6197787a6c12c7fba (diff)
parent66177c3dfd449df65b3fdafdd2921c38c6385db4 (diff)
downloadandroid_packages_apps_CertInstaller-477d2ea4810dea406ffb285f778186e40e871018.tar.gz
android_packages_apps_CertInstaller-477d2ea4810dea406ffb285f778186e40e871018.tar.bz2
android_packages_apps_CertInstaller-477d2ea4810dea406ffb285f778186e40e871018.zip
Merge "Add dialog when installing HS 2.0 credentials while wifi is off." into mnc-dev
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/certinstaller/CredentialsInstallDialog.java8
-rw-r--r--src/com/android/certinstaller/WiFiInstaller.java11
2 files changed, 15 insertions, 4 deletions
diff --git a/src/com/android/certinstaller/CredentialsInstallDialog.java b/src/com/android/certinstaller/CredentialsInstallDialog.java
index 3c86469..53a44ec 100644
--- a/src/com/android/certinstaller/CredentialsInstallDialog.java
+++ b/src/com/android/certinstaller/CredentialsInstallDialog.java
@@ -48,12 +48,16 @@ public class CredentialsInstallDialog extends Activity {
Bundle bundle = getIntent().getExtras();
int installState = getIntent().getIntExtra(INSTALL_STATE, 0);
TextView text = (TextView) layout.findViewById(R.id.credential_installed_content);
- if (installState == 1) {
+ if (installState == WiFiInstaller.INSTALL_SUCCESS) {
String networkName = bundle.getString(NETWORK_NAME);
text.setText(String.format(getResources().getString(R.string.install_done), networkName));
builder.setTitle(getResources().getString(R.string.install_done_title));
- } else {
+ } else if (installState == WiFiInstaller.INSTALL_FAIL){
text.setText(getResources().getString(R.string.wifi_installer_fail));
+ builder.setTitle(R.string.wifi_installer_fail_title);
+ } else if (installState == WiFiInstaller.INSTALL_FAIL_NO_WIFI) {
+ text.setText(getResources().getString(R.string.wifi_installer_fail_no_wifi));
+ builder.setTitle(R.string.wifi_installer_fail_no_wifi_title);
}
builder.setPositiveButton(R.string.done_label, new DialogInterface.OnClickListener() {
@Override
diff --git a/src/com/android/certinstaller/WiFiInstaller.java b/src/com/android/certinstaller/WiFiInstaller.java
index aa58c22..ee74cda 100644
--- a/src/com/android/certinstaller/WiFiInstaller.java
+++ b/src/com/android/certinstaller/WiFiInstaller.java
@@ -27,6 +27,9 @@ public class WiFiInstaller extends Activity {
private static final String TAG = "WifiInstaller";
private static final String NETWORK_NAME = "network_name";
private static final String INSTALL_STATE = "install_state";
+ public static final int INSTALL_SUCCESS = 2;
+ public static final int INSTALL_FAIL = 1;
+ public static final int INSTALL_FAIL_NO_WIFI = 0;
WifiConfiguration mWifiConfiguration;
WifiManager mWifiManager;
boolean doNotInstall;
@@ -102,12 +105,16 @@ public class WiFiInstaller extends Activity {
Intent intent = new Intent(getApplicationContext(),
CredentialsInstallDialog.class);
intent.putExtra(NETWORK_NAME, mWifiConfiguration.providerFriendlyName);
- intent.putExtra(INSTALL_STATE, 1);
+ intent.putExtra(INSTALL_STATE, INSTALL_SUCCESS);
startActivity(intent);
} else {
Intent intent = new Intent(getApplicationContext(),
CredentialsInstallDialog.class);
- intent.putExtra(INSTALL_STATE, 0);
+ if (!mWifiManager.isWifiEnabled()) {
+ intent.putExtra(INSTALL_STATE, INSTALL_FAIL_NO_WIFI);
+ } else {
+ intent.putExtra(INSTALL_STATE, INSTALL_FAIL);
+ }
startActivity(intent);
}
dialog.dismiss();