Implement context menu for ConnectedAccessPointPreference

1) User wants to long press ConnectedAccessPointPreference to forget network if this
is a captive portal network.
2) Change context menu string

Bug: 113756562
Test: make RunSettingsRoboTests -j32 ROBOTEST_FILTER=com.android.settings.wifi
Change-Id: If5c45c45fe126f627eeb53a6c1873a070ad23ae8
(cherry picked from commit 9f8522565a)
This commit is contained in:
cosmohsieh
2019-04-02 18:05:34 +08:00
committed by Cosmo Hsieh
parent e128d27a7a
commit faede7ceb9
4 changed files with 50 additions and 19 deletions

View File

@@ -20,6 +20,7 @@ import android.content.Context;
import android.view.View;
import androidx.annotation.DrawableRes;
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceViewHolder;
import com.android.settings.R;
@@ -29,15 +30,16 @@ import com.android.settingslib.wifi.AccessPointPreference;
/**
* An AP preference for the currently connected AP
*/
public class ConnectedAccessPointPreference extends AccessPointPreference implements
public class ConnectedAccessPointPreference extends LongPressAccessPointPreference implements
View.OnClickListener {
private OnGearClickListener mOnGearClickListener;
private boolean mIsCaptivePortal;
public ConnectedAccessPointPreference(AccessPoint accessPoint, Context context,
UserBadgeCache cache, @DrawableRes int iconResId, boolean forSavedNetworks) {
super(accessPoint, context, cache, iconResId, forSavedNetworks);
UserBadgeCache cache, @DrawableRes int iconResId, boolean forSavedNetworks,
Fragment fragment) {
super(accessPoint, context, cache, forSavedNetworks, iconResId, fragment);
}
@Override