diff --git a/res/drawable-hdpi/wifi_assistant_card.png b/res/drawable-hdpi/wifi_assistant_card.png
deleted file mode 100644
index 5a7e6d117d3..00000000000
Binary files a/res/drawable-hdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-hdpi/wifi_assistant_card_tablet.png b/res/drawable-hdpi/wifi_assistant_card_tablet.png
deleted file mode 100644
index d309533c3c7..00000000000
Binary files a/res/drawable-hdpi/wifi_assistant_card_tablet.png and /dev/null differ
diff --git a/res/drawable-ldrtl-hdpi/wifi_assistant_card.png b/res/drawable-ldrtl-hdpi/wifi_assistant_card.png
deleted file mode 100644
index 67a93b3cc93..00000000000
Binary files a/res/drawable-ldrtl-hdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-ldrtl-mdpi/wifi_assistant_card.png b/res/drawable-ldrtl-mdpi/wifi_assistant_card.png
deleted file mode 100644
index 578454c89aa..00000000000
Binary files a/res/drawable-ldrtl-mdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-ldrtl-xhdpi/wifi_assistant_card.png b/res/drawable-ldrtl-xhdpi/wifi_assistant_card.png
deleted file mode 100644
index 8840a6a9de5..00000000000
Binary files a/res/drawable-ldrtl-xhdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-ldrtl-xxhdpi/wifi_assistant_card.png b/res/drawable-ldrtl-xxhdpi/wifi_assistant_card.png
deleted file mode 100644
index 1273b73d6ea..00000000000
Binary files a/res/drawable-ldrtl-xxhdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-ldrtl-xxxhdpi/wifi_assistant_card.png b/res/drawable-ldrtl-xxxhdpi/wifi_assistant_card.png
deleted file mode 100644
index 7c7bf0aba87..00000000000
Binary files a/res/drawable-ldrtl-xxxhdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-mdpi/wifi_assistant_card.png b/res/drawable-mdpi/wifi_assistant_card.png
deleted file mode 100644
index bb2114ccd91..00000000000
Binary files a/res/drawable-mdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-mdpi/wifi_assistant_card_tablet.png b/res/drawable-mdpi/wifi_assistant_card_tablet.png
deleted file mode 100644
index 0ca411c4170..00000000000
Binary files a/res/drawable-mdpi/wifi_assistant_card_tablet.png and /dev/null differ
diff --git a/res/drawable-xhdpi/wifi_assistant_card.png b/res/drawable-xhdpi/wifi_assistant_card.png
deleted file mode 100644
index 1f8a5b90712..00000000000
Binary files a/res/drawable-xhdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-xhdpi/wifi_assistant_card_tablet.png b/res/drawable-xhdpi/wifi_assistant_card_tablet.png
deleted file mode 100644
index 570a6635907..00000000000
Binary files a/res/drawable-xhdpi/wifi_assistant_card_tablet.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/wifi_assistant_card.png b/res/drawable-xxhdpi/wifi_assistant_card.png
deleted file mode 100644
index 65211cdc08f..00000000000
Binary files a/res/drawable-xxhdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-xxhdpi/wifi_assistant_card_tablet.png b/res/drawable-xxhdpi/wifi_assistant_card_tablet.png
deleted file mode 100644
index 2941b144d27..00000000000
Binary files a/res/drawable-xxhdpi/wifi_assistant_card_tablet.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/wifi_assistant_card.png b/res/drawable-xxxhdpi/wifi_assistant_card.png
deleted file mode 100644
index e79330b8685..00000000000
Binary files a/res/drawable-xxxhdpi/wifi_assistant_card.png and /dev/null differ
diff --git a/res/drawable-xxxhdpi/wifi_assistant_card_tablet.png b/res/drawable-xxxhdpi/wifi_assistant_card_tablet.png
deleted file mode 100644
index 54120fb61bf..00000000000
Binary files a/res/drawable-xxxhdpi/wifi_assistant_card_tablet.png and /dev/null differ
diff --git a/res/layout/wifi_assistant_card.xml b/res/layout/wifi_assistant_card.xml
deleted file mode 100644
index b7ab7b94185..00000000000
--- a/res/layout/wifi_assistant_card.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 6ccced243d2..961fb2f6087 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -45,8 +45,6 @@
#ff00e4ff
#ff0096a6
- #ff009587
-
#ffffffff
#80000000
#ffffffff
diff --git a/res/values/strings.xml b/res/values/strings.xml
index fbf37abbd41..a7cdad2971d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1328,20 +1328,8 @@
Remember settings
-
- Introducing\nWi\u2011Fi Assistant
-
- NO, THANKS
-
- SET UP
-
- Automatically connect to available networks with a Wi\u2011Fi Assistant.
Wi\u2011Fi Assistant
-
- %1$s automatically connects you to the best available Wi\u2011Fi
-
- OPEN APP
Cast screen
diff --git a/res/values/styles.xml b/res/values/styles.xml
index cd6883f0848..0e83d90c467 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -305,27 +305,6 @@
- 18sp
-
-
-
-
-
-
-
-
33554432
diff --git a/src/com/android/settings/wifi/AdvancedWifiSettings.java b/src/com/android/settings/wifi/AdvancedWifiSettings.java
index 29056d731be..c1851422c89 100644
--- a/src/com/android/settings/wifi/AdvancedWifiSettings.java
+++ b/src/com/android/settings/wifi/AdvancedWifiSettings.java
@@ -129,7 +129,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment
pref.setIntent(intent);
final Context context = getActivity();
- NetworkScorerAppData scorer = WifiSettings.getWifiAssistantApp(context);
+ NetworkScorerAppData scorer = getWifiAssistantApp(context);
SwitchPreference wifiAssistant = (SwitchPreference)findPreference(KEY_WIFI_ASSISTANT);
if (scorer != null) {
final boolean checked = NetworkScorerAppManager.getActiveScorer(context) != null;
@@ -265,7 +265,7 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment
return true;
}
- NetworkScorerAppData wifiAssistant = WifiSettings.getWifiAssistantApp(context);
+ NetworkScorerAppData wifiAssistant = getWifiAssistantApp(context);
Intent intent = new Intent();
if (wifiAssistant.mConfigurationActivityClassName != null) {
// App has a custom configuration activity; launch that.
@@ -316,6 +316,22 @@ public class AdvancedWifiSettings extends SettingsPreferenceFragment
wifiIpAddressPref.setSelectable(false);
}
+ /**
+ * Returns the Network Scorer for the Wifi Assistant App.
+ */
+ public static NetworkScorerAppData getWifiAssistantApp(Context context) {
+ Collection scorers =
+ NetworkScorerAppManager.getAllValidScorers(context);
+
+ if (scorers.isEmpty()) {
+ return null;
+ }
+
+ // TODO: b/13780935 - Implement proper scorer selection. Rather than pick the first
+ // scorer on the system, we should allow the user to select one.
+ return scorers.iterator().next();
+ }
+
/* Wrapper class for the WPS dialog to properly handle life cycle events like rotation. */
public static class WpsFragment extends DialogFragment {
private static int mWpsSetup;
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 76ebcca2d8f..9dfd2016121 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -27,7 +27,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.SharedPreferences;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.location.LocationManager;
@@ -35,15 +34,11 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.DetailedState;
import android.net.NetworkInfo.State;
-import android.net.NetworkScoreManager;
-import android.net.NetworkScorerAppManager;
-import android.net.NetworkScorerAppManager.NetworkScorerAppData;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.WpsInfo;
-import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -53,14 +48,11 @@ import android.preference.PreferenceScreen;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
-import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
-import android.view.View.OnClickListener;
import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
@@ -91,8 +83,6 @@ public class WifiSettings extends RestrictedSettingsFragment
private static final String TAG = "WifiSettings";
- private static final int REQUEST_ENABLE_WIFI_ASSISTANT = 1;
-
/* package */ static final int MENU_ID_WPS_PBC = Menu.FIRST;
private static final int MENU_ID_WPS_PIN = Menu.FIRST + 1;
private static final int MENU_ID_SAVED_NETWORK = Menu.FIRST + 2;
@@ -104,8 +94,6 @@ public class WifiSettings extends RestrictedSettingsFragment
private static final int MENU_ID_MODIFY = Menu.FIRST + 8;
private static final int MENU_ID_WRITE_NFC = Menu.FIRST + 9;
- private static final String KEY_ASSISTANT_DISMISS_PLATFORM = "assistant_dismiss_platform";
-
public static final int WIFI_DIALOG_ID = 1;
/* package */ static final int WPS_PBC_DIALOG_ID = 2;
private static final int WPS_PIN_DIALOG_ID = 3;
@@ -157,8 +145,6 @@ public class WifiSettings extends RestrictedSettingsFragment
private boolean mDlgEdit;
private AccessPoint mDlgAccessPoint;
private Bundle mAccessPointSavedState;
- private View mWifiAssistantCard;
- private NetworkScorerAppData mWifiAssistantApp;
/** verbose logging flag. this flag is set thru developer debugging options
* and used so as to assist with in-the-field WiFi connectivity debugging */
@@ -325,8 +311,6 @@ public class WifiSettings extends RestrictedSettingsFragment
addPreferencesFromResource(R.xml.wifi_settings);
- prepareWifiAssistantCard();
-
mEmptyView = initEmptyView();
registerForContextMenu(getListView());
setHasOptionsMenu(true);
@@ -349,19 +333,6 @@ public class WifiSettings extends RestrictedSettingsFragment
}
}
- @Override
- public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
- if (requestCode == REQUEST_ENABLE_WIFI_ASSISTANT) {
- if (resultCode == Activity.RESULT_OK) {
- disableWifiAssistantCardUntilPlatformUpgrade();
- getListView().removeHeaderView(mWifiAssistantCard);
- mWifiAssistantApp = null;
- }
- } else {
- super.onActivityResult(requestCode, resultCode, resultData);
- }
- }
-
@Override
public void onDestroyView() {
super.onDestroyView();
@@ -692,11 +663,6 @@ public class WifiSettings extends RestrictedSettingsFragment
addMessagePreference(R.string.wifi_empty_list_wifi_on);
}
- getListView().removeHeaderView(mWifiAssistantCard);
- if (mWifiAssistantApp != null) {
- getListView().addHeaderView(mWifiAssistantCard);
- }
-
for (AccessPoint accessPoint : accessPoints) {
// Ignore access points that are out of range.
if (accessPoint.getLevel() != -1) {
@@ -719,102 +685,6 @@ public class WifiSettings extends RestrictedSettingsFragment
}
}
- /**
- * Returns the Network Scorer for the Wifi Assistant App.
- */
- public static NetworkScorerAppData getWifiAssistantApp(Context context) {
- Collection scorers =
- NetworkScorerAppManager.getAllValidScorers(context);
-
- if (scorers.isEmpty()) {
- return null;
- }
-
- // TODO: b/13780935 - Implement proper scorer selection. Rather than pick the first
- // scorer on the system, we should allow the user to select one.
- return scorers.iterator().next();
- }
-
- private void prepareWifiAssistantCard() {
- if (getActivity() instanceof WifiPickerActivity) {
- return;
- }
-
- if (NetworkScorerAppManager.getActiveScorer(getActivity()) != null) {
- // A scorer is already enabled; don't show the card.
- return;
- }
-
- Collection scorers =
- NetworkScorerAppManager.getAllValidScorers(getActivity());
- if (scorers.isEmpty()) {
- // No scorers are available to enable; don't show the card.
- return;
- }
-
- SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
- int lastDismissPlatform = sharedPreferences.getInt(KEY_ASSISTANT_DISMISS_PLATFORM, 0);
-
- if (Build.VERSION.SDK_INT <= lastDismissPlatform) {
- // User has dismissed the Wi-Fi assistant card on this SDK release. Suppress the card
- // until the next major platform upgrade.
- return;
- }
-
- // TODO: b/13780935 - Implement proper scorer selection. Rather than pick the first
- // scorer on the system, we should allow the user to select one.
- mWifiAssistantApp = scorers.iterator().next();
-
- if (mWifiAssistantCard == null) {
- mWifiAssistantCard = LayoutInflater.from(getActivity())
- .inflate(R.layout.wifi_assistant_card, getListView(), false);
- Button setup = (Button) mWifiAssistantCard.findViewById(R.id.setup);
- Button noThanks = (Button) mWifiAssistantCard.findViewById(R.id.no_thanks_button);
- TextView assistantText =
- (TextView) mWifiAssistantCard.findViewById(R.id.wifi_assistant_text);
- assistantText.setText(getResources().getString(
- R.string.wifi_assistant_title_message, mWifiAssistantApp.mScorerName));
-
- if (setup != null && noThanks != null) {
- setup.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent intent = new Intent();
- if (mWifiAssistantApp.mConfigurationActivityClassName != null) {
- // App has a custom configuration activity; launch that.
- // This custom activity will be responsible for launching the system
- // dialog.
- intent.setClassName(mWifiAssistantApp.mPackageName,
- mWifiAssistantApp.mConfigurationActivityClassName);
- } else {
- // Fall back on the system dialog.
- intent.setAction(NetworkScoreManager.ACTION_CHANGE_ACTIVE);
- intent.putExtra(NetworkScoreManager.EXTRA_PACKAGE_NAME,
- mWifiAssistantApp.mPackageName);
- }
- startActivityForResult(intent, REQUEST_ENABLE_WIFI_ASSISTANT);
- }
- });
-
- noThanks.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- disableWifiAssistantCardUntilPlatformUpgrade();
- getListView().removeHeaderView(mWifiAssistantCard);
- mWifiAssistantApp = null;
- }
- });
- }
- }
- }
-
- private void disableWifiAssistantCardUntilPlatformUpgrade() {
- SharedPreferences sharedPreferences = getPreferenceScreen().getSharedPreferences();
- SharedPreferences.Editor editor = sharedPreferences.edit();
- editor.putInt(KEY_ASSISTANT_DISMISS_PLATFORM, Build.VERSION.SDK_INT);
- editor.apply();
- }
-
protected TextView initEmptyView() {
TextView emptyView = (TextView) getActivity().findViewById(android.R.id.empty);
getListView().setEmptyView(emptyView);