Revert^2 "Clean up unused WifiManager.ActionListener"

This reverts commit c4a0abef8c.

Reason for revert: The original is not the root cause.
Root cause is b/294378814

Change-Id: Ib44ad912073b0f1b06c7ef6b6b998581eef65784
This commit is contained in:
Chaohui Wang
2023-08-04 02:02:13 +00:00
parent c001665f00
commit 79a978989f
4 changed files with 0 additions and 91 deletions

View File

@@ -1,48 +0,0 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.wifi;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.widget.Toast;
import com.android.settings.R;
/**
* A listener to display a toast on failure to connect
*/
public class WifiConnectListener implements WifiManager.ActionListener {
private final Context mContext;
public WifiConnectListener(Context context) {
mContext = context;
}
@Override
public void onSuccess() {
}
@Override
public void onFailure(int reason) {
if (mContext != null) {
Toast.makeText(mContext,
R.string.wifi_failed_connect_message,
Toast.LENGTH_SHORT).show();
}
}
}

View File

@@ -59,7 +59,6 @@ import com.android.settings.LinkifyUtils;
import com.android.settings.R;
import com.android.settings.RestrictedSettingsFragment;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.datausage.DataUsagePreference;
@@ -175,9 +174,7 @@ public class WifiSettings extends RestrictedSettingsFragment
};
protected WifiManager mWifiManager;
private WifiManager.ActionListener mConnectListener;
private WifiManager.ActionListener mSaveListener;
private WifiManager.ActionListener mForgetListener;
/**
* The state of {@link #isUiRestricted()} at {@link #onCreate(Bundle)}}. This is neccesary to
@@ -310,8 +307,6 @@ public class WifiSettings extends RestrictedSettingsFragment
mWifiManager = getActivity().getSystemService(WifiManager.class);
}
mConnectListener = new WifiConnectListener(getActivity());
mSaveListener = new WifiManager.ActionListener() {
@Override
public void onSuccess() {
@@ -328,21 +323,6 @@ public class WifiSettings extends RestrictedSettingsFragment
}
};
mForgetListener = new WifiManager.ActionListener() {
@Override
public void onSuccess() {
}
@Override
public void onFailure(int reason) {
Activity activity = getActivity();
if (activity != null) {
Toast.makeText(activity,
R.string.wifi_failed_forget_message,
Toast.LENGTH_SHORT).show();
}
}
};
registerForContextMenu(getListView());
setHasOptionsMenu(true);