Remove TetherUtil functions which are no longer needed.

Change-Id: I8559a2aaffa44e165d4e5e9070a85f23ed02b58b
This commit is contained in:
Jeremy Klein
2016-01-29 12:46:42 -08:00
parent e3e7b95312
commit 3a14416d55
4 changed files with 8 additions and 11 deletions

View File

@@ -25,14 +25,15 @@ import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.net.ConnectivityManager;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.MeasureSpec;
import android.widget.ImageView;
import android.widget.ListView;
import com.android.settings.Settings.TetherSettingsActivity;
import com.android.settingslib.TetherUtil;
import java.util.List;
@@ -91,11 +92,13 @@ public class CreateShortcut extends LauncherActivity {
protected List<ResolveInfo> onQueryPackageManager(Intent queryIntent) {
List<ResolveInfo> activities = getPackageManager().queryIntentActivities(queryIntent,
PackageManager.GET_META_DATA);
final ConnectivityManager cm =
(ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (activities == null) return null;
for (int i = activities.size() - 1; i >= 0; i--) {
ResolveInfo info = activities.get(i);
if (info.activityInfo.name.endsWith(TetherSettingsActivity.class.getSimpleName())) {
if (!TetherUtil.isTetheringSupported(this)) {
if (!cm.isTetheringSupported()) {
activities.remove(i);
}
}

View File

@@ -251,13 +251,6 @@ public class TetherService extends Service {
}
}
public static void scheduleRecheckAlarm(Context context, int type) {
Intent intent = new Intent(context, TetherService.class);
intent.putExtra(ConnectivityManager.EXTRA_ADD_TETHER_TYPE, type);
intent.putExtra(ConnectivityManager.EXTRA_SET_ALARM, true);
context.startService(intent);
}
private void scheduleAlarm() {
Intent intent = new Intent(this, TetherService.class);
intent.putExtra(ConnectivityManager.EXTRA_RUN_PROVISION, true);

View File

@@ -319,7 +319,7 @@ public class WirelessSettings extends SettingsPreferenceFragment implements Inde
final boolean adminDisallowedTetherConfig = mUm.hasUserRestriction(
UserManager.DISALLOW_CONFIG_TETHERING);
if (!isAdmin || (!cm.isTetheringSupported() && !adminDisallowedTetherConfig)) {
if (!cm.isTetheringSupported() && !adminDisallowedTetherConfig) {
getPreferenceScreen().removePreference(findPreference(KEY_TETHER_SETTINGS));
} else if (!adminDisallowedTetherConfig) {
Preference p = findPreference(KEY_TETHER_SETTINGS);

View File

@@ -21,6 +21,7 @@ import android.content.Intent;
import android.graphics.drawable.Icon;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import com.android.settings.R;
import com.android.settings.TetherSettings;
import com.android.settings.Utils;
@@ -37,7 +38,7 @@ public class HotspotCondition extends Condition {
@Override
public void refreshState() {
boolean wifiTetherEnabled = TetherUtil.isWifiTetherEnabled(mManager.getContext());
boolean wifiTetherEnabled = mWifiManager.isWifiApEnabled();
setActive(wifiTetherEnabled);
}