Merge "Fix "Add Network" button on SavedAccessPoints page."
This commit is contained in:
committed by
Android (Google) Code Review
commit
ac8a3f24c4
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.wifi;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.icu.text.Collator;
|
||||
@@ -28,6 +29,7 @@ import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceScreen;
|
||||
import android.util.Log;
|
||||
|
||||
import android.widget.Toast;
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
@@ -88,6 +90,22 @@ public class SavedAccessPointsWifiSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
};
|
||||
|
||||
private final WifiManager.ActionListener mSaveListener = new WifiManager.ActionListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
postUpdatePreference();
|
||||
}
|
||||
@Override
|
||||
public void onFailure(int reason) {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null) {
|
||||
Toast.makeText(activity,
|
||||
R.string.wifi_failed_save_message,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private WifiDialog mDialog;
|
||||
private WifiManagerWrapper mWifiManager;
|
||||
private AccessPoint mDlgAccessPoint;
|
||||
@@ -267,7 +285,7 @@ public class SavedAccessPointsWifiSettings extends SettingsPreferenceFragment
|
||||
|
||||
@Override
|
||||
public void onSubmit(WifiDialog dialog) {
|
||||
// Ignored
|
||||
mWifiManager.save(dialog.getController().getConfig(), mSaveListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user