Merge "Fix crash while trying to connect to network in WiFi Settings."
diff --git a/proguard.flags b/proguard.flags
index 694ab29..578ff4d 100644
--- a/proguard.flags
+++ b/proguard.flags
@@ -7,6 +7,8 @@
 -keep class com.android.settings.bluetooth.*
 -keep class com.android.settings.applications.*
 -keep class com.android.settings.inputmethod.*
+-keep class com.android.settings.ResetNetwork
+-keep class com.android.settings.ResetNetworkConfirm
 -keep class com.android.settings.MasterClear
 -keep class com.android.settings.MasterClearConfirm
 -keep class com.android.settings.accounts.*
diff --git a/res/layout/reset_network.xml b/res/layout/reset_network.xml
new file mode 100644
index 0000000..ab96ea7
--- /dev/null
+++ b/res/layout/reset_network.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="0dip"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
+        android:layout_marginTop="12dp"
+        android:layout_weight="1">
+
+        <LinearLayout android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textSize="18sp"
+                android:text="@string/reset_network_desc" />
+
+        </LinearLayout>
+
+    </ScrollView>
+
+    <Spinner android:id="@+id/reset_network_subscription"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="20dip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+    <Button
+        android:id="@+id/initiate_reset_network"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="20dip"
+        android:layout_marginBottom="12dip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/reset_network_button_text"
+        android:gravity="center" />
+
+</LinearLayout>
diff --git a/res/layout/reset_network_confirm.xml b/res/layout/reset_network_confirm.xml
new file mode 100644
index 0000000..ffaafb3
--- /dev/null
+++ b/res/layout/reset_network_confirm.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="12dp"
+        android:layout_marginEnd="12dp"
+        android:layout_marginTop="12dp"
+        android:textSize="20sp"
+        android:text="@string/reset_network_final_desc" />
+
+    <Button android:id="@+id/execute_reset_network"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="40dip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/reset_network_final_button_text"
+        android:gravity="center" />
+
+</LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1ea2533..14670a7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2403,15 +2403,29 @@
     <!-- APNs screen toast message to inform reset default APN settings is completed -->
     <string name="restore_default_apn_completed">Reset default APN settings completed.</string>
 
+    <!-- Reset Network -->
+    <!-- SD card & phone storage settings screen, setting option name under Backup & Restore heading -->
+    <string name="reset_network_title">Network settings reset</string>
+    <!-- SD card & phone storage settings screen, message on screen after user selects Reset network settings [CHAR LIMIT=NONE] -->
+    <string name="reset_network_desc">This will reset all settings related to networking to the factory defaults, including:\n\n<li>Wifi</li>\n<li>Mobile data</li>\n<li>Bluetooth</li>"</string>
+    <!-- SD card & phone storage settings screen, button on screen after user selects Reset network settings -->
+    <string name="reset_network_button_text">Reset settings</string>
+    <!-- SD card & phone storage settings screen, message on screen after user selects Reset settings button -->
+    <string name="reset_network_final_desc">Reset all network settings? You can\'t reverse this action!</string>
+    <!-- SD card & phone storage settings screen, button on screen after user selects Reset settings button -->
+    <string name="reset_network_final_button_text">Reset settings</string>
+    <!-- Explanation of drawing unlock pattern to reset settings -->
+    <string name="reset_network_gesture_explanation">You need to draw your unlock pattern to confirm a network settings reset.</string>
+    <!-- Reset settings confirmation screen title [CHAR LIMIT=30] -->
+    <string name="reset_network_confirm_title">Reset?</string>
+    <!-- Reset settings complete toast text [CHAR LIMIT=75] -->
+    <string name="reset_network_complete_toast">Network settings reset</string>
+
     <!-- Master Clear -->
     <!-- SD card & phone storage settings screen, setting option name under Internal phone storage heading [CHAR LIMIT=30] -->
     <string name="device_reset_title">Reset device</string>
     <!-- SD card & phone storage settings screen, setting option name under Internal phone storage heading -->
     <string name="master_clear_title">Factory data reset</string>
-    <!-- SD card & phone storage settings screen, setting option summary text under Internal phone storage heading -->
-    <string name="master_clear_summary" product="tablet">Erases all data on tablet</string>
-    <!-- SD card & phone storage settings screen, setting option summary text under Internal phone storage heading -->
-    <string name="master_clear_summary" product="default">Erases all data on phone</string>
     <!-- SD card & phone storage settings screen, message on screen after user selects Factory data reset [CHAR LIMIT=NONE] -->
     <string name="master_clear_desc" product="tablet">"This will erase all data from your tablet\'s <b>internal storage</b>, including:\n\n<li>Your Google account</li>\n<li>System and app data and settings</li>\n<li>Downloaded apps</li>"</string>
     <!-- SD card & phone storage settings screen, message on screen after user selects Factory data reset [CHAR LIMIT=NONE] -->
@@ -4370,8 +4384,6 @@
     <string name="backup_data_summary">Back up app data, Wi\u2011Fi passwords, and other settings to Google servers</string>
     <!-- Configure backup account options menu title [CHAR LIMIT=25]-->
     <string name="backup_configure_account_title">Backup account</string>
-    <!-- Default summary text of the "Configure backup account" setting [CHAR LIMIT=80]-->
-    <string name="backup_configure_account_default_summary">No account is currently storing backed up data</string>
     <!-- Auto-restore menu title [CHAR LIMIT=30] -->
     <string name="include_app_data_title">Include app data</string>
     <!-- Auto-restore menu title -->
@@ -4380,8 +4392,6 @@
     <string name="auto_restore_summary">When reinstalling an app, restore backed up settings and data</string>
     <!-- Title of the preference informing the user about the backup service being inactive [CHAR LIMIT=50]-->
     <string name="backup_inactive_title">Backup service is inactive.</string>
-    <!-- Summary text of the preference informing the user about the backup service being inactive, explaining that this is likely set by device policy [CHAR LIMIT=150]-->
-    <string name="backup_inactive_summary">This is set by your device policy.</string>
 
     <!-- Local (desktop) backup password menu title [CHAR LIMIT=25] -->
     <string name="local_backup_password_title">Desktop backup password</string>
diff --git a/res/xml/privacy_settings.xml b/res/xml/privacy_settings.xml
index 4760300..4607254 100644
--- a/res/xml/privacy_settings.xml
+++ b/res/xml/privacy_settings.xml
@@ -15,54 +15,47 @@
 -->
 
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
-                  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
-        android:title="@string/privacy_settings_title">
+    xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+    android:title="@string/privacy_settings_title">
 
-    <PreferenceCategory android:key="backup_category"
-            android:title="@string/backup_section_title">
+    <!-- Backup settings -->
+    <SwitchPreference
+        android:key="backup_data"
+        android:title="@string/backup_data_title"
+        android:summary="@string/backup_data_summary"
+        android:persistent="false" />
 
-        <!-- Backup settings -->
-        <SwitchPreference
-                android:key="backup_data"
-                android:title="@string/backup_data_title"
-                android:summary="@string/backup_data_summary"
-                android:persistent="false" />
+    <PreferenceScreen
+        android:key="configure_account"
+        android:title="@string/backup_configure_account_title"
+        android:persistent="false">
+        <!-- the Intent declared here is always overwritten by a real one -->
+        <intent android:action="dummy" />
+    </PreferenceScreen>
 
-        <PreferenceScreen
-                android:key="configure_account"
-                android:title="@string/backup_configure_account_title"
-                android:summary="@string/backup_configure_account_default_summary"
-                android:persistent="false">
-            <!-- the Intent declared here is always overwritten by a real one -->
-            <intent android:action="dummy" />
-        </PreferenceScreen>
+    <SwitchPreference
+        android:key="auto_restore"
+        android:title="@string/auto_restore_title"
+        android:summary="@string/auto_restore_summary"
+        android:persistent="false" />
 
-        <SwitchPreference
-                android:key="auto_restore"
-                android:title="@string/auto_restore_title"
-                android:summary="@string/auto_restore_summary"
-                android:persistent="false" />
+    <Preference
+        android:key="backup_inactive"
+        android:title="@string/backup_inactive_title"
+        android:persistent="false"
+        android:enabled="false"
+        android:selectable="false" />
 
-        <Preference
-                android:key="backup_inactive"
-                android:title="@string/backup_inactive_title"
-                android:summary="@string/backup_inactive_summary"
-                android:persistent="false"
-                android:enabled="false"
-                android:selectable="false" />
+    <!-- Network reset -->
+    <PreferenceScreen
+        android:title="@string/reset_network_title"
+        android:fragment="com.android.settings.ResetNetwork" />
 
-    </PreferenceCategory>
-
-    <PreferenceCategory android:key="personal_data_category"
-            android:title="@string/personal_data_section_title">
-
-        <!-- Factory reset -->
-        <PreferenceScreen
-            android:title="@string/master_clear_title"
-            android:summary="@string/master_clear_summary"
-            settings:keywords="@string/keywords_factory_data_reset"
-            android:fragment="com.android.settings.MasterClear" />
-
-    </PreferenceCategory>
+    <!-- Factory reset -->
+    <PreferenceScreen
+        android:key="factory_reset"
+        android:title="@string/master_clear_title"
+        settings:keywords="@string/keywords_factory_data_reset"
+        android:fragment="com.android.settings.MasterClear" />
 
 </PreferenceScreen>
diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java
index 4e14c60..f587b60 100644
--- a/src/com/android/settings/ApnEditor.java
+++ b/src/com/android/settings/ApnEditor.java
@@ -26,10 +26,8 @@
 import android.database.Cursor;
 import android.net.Uri;
 import android.os.Bundle;
-import android.os.SystemProperties;
 import android.preference.EditTextPreference;
 import android.preference.ListPreference;
-import android.preference.CheckBoxPreference;
 import android.preference.Preference;
 import android.preference.PreferenceActivity;
 import android.preference.SwitchPreference;
@@ -41,11 +39,6 @@
 import android.view.Menu;
 import android.view.MenuItem;
 
-import com.android.internal.telephony.Phone;
-import com.android.internal.telephony.PhoneConstants;
-import com.android.internal.telephony.RILConstants;
-import com.android.internal.telephony.TelephonyProperties;
-
 
 public class ApnEditor extends PreferenceActivity
         implements SharedPreferences.OnSharedPreferenceChangeListener,
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java
index 670924c..79a3825 100644
--- a/src/com/android/settings/ApnSettings.java
+++ b/src/com/android/settings/ApnSettings.java
@@ -35,25 +35,20 @@
 import android.os.Message;
 import android.os.UserManager;
 import android.preference.Preference;
-import android.preference.PreferenceActivity;
 import android.preference.PreferenceGroup;
 import android.preference.PreferenceScreen;
 import android.provider.Telephony;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.util.Log;
-import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
-import android.view.View;
 import android.widget.TextView;
 import android.widget.Toast;
 
-import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.telephony.TelephonyIntents;
-import com.android.internal.telephony.TelephonyProperties;
 import android.telephony.TelephonyManager;
 
 import java.util.ArrayList;
diff --git a/src/com/android/settings/AppPicker.java b/src/com/android/settings/AppPicker.java
index e58b835..1f3d42b 100644
--- a/src/com/android/settings/AppPicker.java
+++ b/src/com/android/settings/AppPicker.java
@@ -24,7 +24,6 @@
 
 import com.android.settings.applications.AppViewHolder;
 
-import android.app.ActivityManagerNative;
 import android.app.ListActivity;
 import android.content.Context;
 import android.content.Intent;
@@ -32,8 +31,6 @@
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Process;
-import android.os.RemoteException;
-import android.provider.Settings;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index aeb3827..6cec420 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -23,7 +23,6 @@
 import android.app.DialogFragment;
 import android.app.Fragment;
 import android.app.FragmentManager;
-import android.app.PendingIntent;
 import android.app.admin.DevicePolicyManager;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -39,13 +38,7 @@
 import android.service.fingerprint.FingerprintManagerReceiver;
 import android.util.EventLog;
 import android.util.Log;
-import android.util.MutableBoolean;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityManager;
-import android.widget.ListView;
-
 import com.android.internal.widget.LockPatternUtils;
 
 import java.util.List;
diff --git a/src/com/android/settings/ChooseLockPattern.java b/src/com/android/settings/ChooseLockPattern.java
index b64f102..6343468 100644
--- a/src/com/android/settings/ChooseLockPattern.java
+++ b/src/com/android/settings/ChooseLockPattern.java
@@ -27,11 +27,9 @@
 
 import android.app.Activity;
 import android.app.Fragment;
-import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
-import android.provider.Settings;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
diff --git a/src/com/android/settings/DataUsageSummary.java b/src/com/android/settings/DataUsageSummary.java
index 3ab1d23..b78cd6e 100644
--- a/src/com/android/settings/DataUsageSummary.java
+++ b/src/com/android/settings/DataUsageSummary.java
@@ -65,7 +65,6 @@
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.pm.UserInfo;
 import android.content.res.Resources;
-import android.content.res.TypedArray;
 import android.graphics.Color;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
@@ -140,7 +139,6 @@
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
 import com.android.settings.search.SearchIndexableRaw;
-import com.android.settings.sim.SimSettings;
 import com.android.settings.widget.ChartDataUsageView;
 import com.android.settings.widget.ChartDataUsageView.DataUsageChartListener;
 import com.android.settings.widget.ChartNetworkSeriesView;
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java
index 6f41fd5..be24ffe 100644
--- a/src/com/android/settings/DateTimeSettings.java
+++ b/src/com/android/settings/DateTimeSettings.java
@@ -29,7 +29,6 @@
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
 import android.os.Bundle;
-import android.preference.ListPreference;
 import android.preference.Preference;
 import android.preference.PreferenceScreen;
 import android.preference.SwitchPreference;
diff --git a/src/com/android/settings/DateTimeSettingsSetupWizard.java b/src/com/android/settings/DateTimeSettingsSetupWizard.java
index bb2c6da..9ad75be 100644
--- a/src/com/android/settings/DateTimeSettingsSetupWizard.java
+++ b/src/com/android/settings/DateTimeSettingsSetupWizard.java
@@ -18,14 +18,10 @@
 
 import android.app.Activity;
 import android.app.AlarmManager;
-import android.app.Fragment;
-import android.app.FragmentTransaction;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
-import android.content.res.Configuration;
 import android.os.Bundle;
 import android.preference.Preference;
 import android.preference.PreferenceFragment;
@@ -42,10 +38,8 @@
 import android.widget.CompoundButton;
 import android.widget.CompoundButton.OnCheckedChangeListener;
 import android.widget.DatePicker;
-import android.widget.LinearLayout;
 import android.widget.ListPopupWindow;
 import android.widget.SimpleAdapter;
-import android.widget.TextView;
 import android.widget.TimePicker;
 
 import java.util.Calendar;
diff --git a/src/com/android/settings/DefaultRingtonePreference.java b/src/com/android/settings/DefaultRingtonePreference.java
index 0801b1f..4607bcd 100644
--- a/src/com/android/settings/DefaultRingtonePreference.java
+++ b/src/com/android/settings/DefaultRingtonePreference.java
@@ -23,7 +23,6 @@
 import android.net.Uri;
 import android.preference.RingtonePreference;
 import android.util.AttributeSet;
-import android.util.Log;
 
 public class DefaultRingtonePreference extends RingtonePreference {
     private static final String TAG = "DefaultRingtonePreference";
diff --git a/src/com/android/settings/DeviceAdminSettings.java b/src/com/android/settings/DeviceAdminSettings.java
index 0e3dc42..f0b3070 100644
--- a/src/com/android/settings/DeviceAdminSettings.java
+++ b/src/com/android/settings/DeviceAdminSettings.java
@@ -32,7 +32,6 @@
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
-import android.content.res.TypedArray;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.UserHandle;
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index f79707a..648615a 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -22,11 +22,8 @@
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
-import android.os.Binder;
 import android.os.Build;
 import android.os.Bundle;
-import android.os.Parcel;
-import android.os.RemoteException;
 import android.os.SELinux;
 import android.os.SystemClock;
 import android.os.SystemProperties;
diff --git a/src/com/android/settings/IccLockSettings.java b/src/com/android/settings/IccLockSettings.java
index c389f5e..efc5a3c 100644
--- a/src/com/android/settings/IccLockSettings.java
+++ b/src/com/android/settings/IccLockSettings.java
@@ -46,9 +46,6 @@
 import com.android.internal.telephony.PhoneFactory;
 import com.android.internal.telephony.TelephonyIntents;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * Implements the preference screen to enable/disable ICC lock and
  * also the dialogs to change the ICC PIN. In the former case, enabling/disabling
diff --git a/src/com/android/settings/LocalePicker.java b/src/com/android/settings/LocalePicker.java
index c6158b1..7a8f120 100644
--- a/src/com/android/settings/LocalePicker.java
+++ b/src/com/android/settings/LocalePicker.java
@@ -23,11 +23,7 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ListView;
-import android.content.Context;
-
 import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
-import com.android.settings.DevelopmentSettings;
-
 import java.util.Locale;
 
 public class LocalePicker extends com.android.internal.app.LocalePicker
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index 18b51d9..9480f67 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -26,7 +26,6 @@
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
 import android.content.res.Resources;
-import android.content.res.TypedArray;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.Environment;
@@ -34,9 +33,7 @@
 import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.preference.Preference;
 import android.util.Log;
-import android.util.SparseArray;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -77,9 +74,8 @@
      */
     private boolean runKeyguardConfirmation(int request) {
         Resources res = getActivity().getResources();
-        return new ChooseLockSettingsHelper(getActivity(), this)
-                .launchConfirmationActivity(request, null,
-                        res.getText(R.string.master_clear_gesture_explanation));
+        return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(request,
+                null, res.getText(R.string.master_clear_gesture_explanation));
     }
 
     @Override
@@ -100,11 +96,10 @@
     }
 
     private void showFinalConfirmation() {
-        Preference preference = new Preference(getActivity());
-        preference.setFragment(MasterClearConfirm.class.getName());
-        preference.setTitle(R.string.master_clear_confirm_title);
-        preference.getExtras().putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked());
-        ((SettingsActivity) getActivity()).onPreferenceStartFragment(null, preference);
+        Bundle args = new Bundle();
+        args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked());
+        ((SettingsActivity) getActivity()).startPreferencePanel(MasterClearConfirm.class.getName(),
+                args, R.string.master_clear_confirm_title, null, null, 0);
     }
 
     /**
diff --git a/src/com/android/settings/OwnerInfoSettings.java b/src/com/android/settings/OwnerInfoSettings.java
index 0761f38..c1cacb9 100644
--- a/src/com/android/settings/OwnerInfoSettings.java
+++ b/src/com/android/settings/OwnerInfoSettings.java
@@ -17,11 +17,9 @@
 package com.android.settings;
 
 import android.app.Fragment;
-import android.content.ContentResolver;
 import android.os.Bundle;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.provider.Settings;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
diff --git a/src/com/android/settings/PrivacySettings.java b/src/com/android/settings/PrivacySettings.java
index 8df78c5..e150298 100644
--- a/src/com/android/settings/PrivacySettings.java
+++ b/src/com/android/settings/PrivacySettings.java
@@ -30,7 +30,6 @@
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.preference.Preference;
-import android.preference.PreferenceCategory;
 import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.PreferenceScreen;
 import android.preference.SwitchPreference;
@@ -40,10 +39,11 @@
 
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
-import com.android.settings.search.Indexable.SearchIndexProvider;
-
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 /**
  * Gesture lock pattern settings.
@@ -53,12 +53,11 @@
 
     // Vendor specific
     private static final String GSETTINGS_PROVIDER = "com.google.settings";
-    private static final String BACKUP_CATEGORY = "backup_category";
     private static final String BACKUP_DATA = "backup_data";
     private static final String AUTO_RESTORE = "auto_restore";
     private static final String CONFIGURE_ACCOUNT = "configure_account";
     private static final String BACKUP_INACTIVE = "backup_inactive";
-    private static final String PERSONAL_DATA_CATEGORY = "personal_data_category";
+    private static final String FACTORY_RESET = "factory_reset";
     private static final String TAG = "PrivacySettings";
     private IBackupManager mBackupManager;
     private SwitchPreference mBackup;
@@ -92,7 +91,8 @@
 
         mConfigure = (PreferenceScreen) screen.findPreference(CONFIGURE_ACCOUNT);
 
-        ArrayList<String> keysToRemove = getNonVisibleKeys(getActivity());
+        Set<String> keysToRemove = new HashSet<>();
+        getNonVisibleKeys(getActivity(), keysToRemove);
         final int screenPreferenceCount = screen.getPreferenceCount();
         for (int i = screenPreferenceCount - 1; i >= 0; --i) {
             Preference preference = screen.getPreference(i);
@@ -100,16 +100,7 @@
                 screen.removePreference(preference);
             }
         }
-        PreferenceCategory backupCategory = (PreferenceCategory) findPreference(BACKUP_CATEGORY);
-        if (backupCategory != null) {
-            final int backupCategoryPreferenceCount = backupCategory.getPreferenceCount();
-            for (int i = backupCategoryPreferenceCount - 1; i >= 0; --i) {
-                Preference preference = backupCategory.getPreference(i);
-                if (keysToRemove.contains(preference.getKey())) {
-                    backupCategory.removePreference(preference);
-                }
-            }
-        }
+
         updateToggles();
     }
 
@@ -300,12 +291,13 @@
 
         @Override
         public List<String> getNonIndexableKeys(Context context) {
-            return getNonVisibleKeys(context);
+            final List<String> nonVisibleKeys = new ArrayList<>();
+            getNonVisibleKeys(context, nonVisibleKeys);
+            return nonVisibleKeys;
         }
     }
 
-    private static ArrayList<String> getNonVisibleKeys(Context context) {
-        final ArrayList<String> nonVisibleKeys = new ArrayList<String>();
+    private static void getNonVisibleKeys(Context context, Collection<String> nonVisibleKeys) {
         final IBackupManager backupManager = IBackupManager.Stub.asInterface(
                 ServiceManager.getService(Context.BACKUP_SERVICE));
         boolean isServiceActive = false;
@@ -315,22 +307,19 @@
             Log.w(TAG, "Failed querying backup manager service activity status. " +
                     "Assuming it is inactive.");
         }
-        if (isServiceActive) {
+        boolean vendorSpecific = context.getPackageManager().
+                resolveContentProvider(GSETTINGS_PROVIDER, 0) == null;
+        if (vendorSpecific || isServiceActive) {
             nonVisibleKeys.add(BACKUP_INACTIVE);
-        } else {
+        }
+        if (vendorSpecific || !isServiceActive) {
+            nonVisibleKeys.add(BACKUP_DATA);
             nonVisibleKeys.add(AUTO_RESTORE);
             nonVisibleKeys.add(CONFIGURE_ACCOUNT);
-            nonVisibleKeys.add(BACKUP_DATA);
         }
         if (UserManager.get(context).hasUserRestriction(
                 UserManager.DISALLOW_FACTORY_RESET)) {
-            nonVisibleKeys.add(PERSONAL_DATA_CATEGORY);
+            nonVisibleKeys.add(FACTORY_RESET);
         }
-        // Vendor specific
-        if (context.getPackageManager().
-                resolveContentProvider(GSETTINGS_PROVIDER, 0) == null) {
-            nonVisibleKeys.add(BACKUP_CATEGORY);
-        }
-        return nonVisibleKeys;
     }
 }
diff --git a/src/com/android/settings/ProxySelector.java b/src/com/android/settings/ProxySelector.java
index 6941271..2c4c473 100644
--- a/src/com/android/settings/ProxySelector.java
+++ b/src/com/android/settings/ProxySelector.java
@@ -23,14 +23,12 @@
 import android.app.Dialog;
 import android.app.Fragment;
 import android.app.admin.DevicePolicyManager;
-import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.net.ConnectivityManager;
 import android.net.Proxy;
 import android.net.ProxyInfo;
 import android.os.Bundle;
-import android.provider.Settings;
 import android.text.Selection;
 import android.text.Spannable;
 import android.text.TextUtils;
@@ -44,8 +42,6 @@
 import android.widget.EditText;
 import android.widget.TextView;
 
-import java.net.InetSocketAddress;
-
 public class ProxySelector extends Fragment implements DialogCreatable {
     private static final String TAG = "ProxySelector";
 
diff --git a/src/com/android/settings/ResetNetwork.java b/src/com/android/settings/ResetNetwork.java
new file mode 100644
index 0000000..7767604
--- /dev/null
+++ b/src/com/android/settings/ResetNetwork.java
@@ -0,0 +1,198 @@
+/*
+ * Copyright (C) 2015 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;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.SystemProperties;
+import android.os.UserManager;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.LinearLayout;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+import com.android.internal.telephony.PhoneConstants;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Confirm and execute a reset of the device's network settings to a clean "just out of the box"
+ * state.  Multiple confirmations are required: first, a general "are you sure you want to do this?"
+ * prompt, followed by a keyguard pattern trace if the user has defined one, followed by a final
+ * strongly-worded "THIS WILL RESET EVERYTHING" prompt.  If at any time the phone is allowed to go
+ * to sleep, is locked, et cetera, then the confirmation sequence is abandoned.
+ *
+ * This is the initial screen.
+ */
+public class ResetNetwork extends Fragment {
+    private static final String TAG = "ResetNetwork";
+
+    // Arbitrary to avoid conficts
+    private static final int KEYGUARD_REQUEST = 55;
+
+    private List<SubscriptionInfo> mSubscriptions;
+
+    private View mContentView;
+    private Spinner mSubscriptionSpinner;
+    private Button mInitiateButton;
+
+    /**
+     * Keyguard validation is run using the standard {@link ConfirmLockPattern}
+     * component as a subactivity
+     * @param request the request code to be returned once confirmation finishes
+     * @return true if confirmation launched
+     */
+    private boolean runKeyguardConfirmation(int request) {
+        Resources res = getActivity().getResources();
+        return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(request,
+                null, res.getText(R.string.reset_network_gesture_explanation));
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+
+        if (requestCode != KEYGUARD_REQUEST) {
+            return;
+        }
+
+        // If the user entered a valid keyguard trace, present the final
+        // confirmation prompt; otherwise, go back to the initial state.
+        if (resultCode == Activity.RESULT_OK) {
+            showFinalConfirmation();
+        } else {
+            establishInitialState();
+        }
+    }
+
+    private void showFinalConfirmation() {
+        Bundle args = new Bundle();
+        if (mSubscriptions.size() > 0) {
+            int selectedIndex = mSubscriptionSpinner.getSelectedItemPosition();
+            SubscriptionInfo subscription = mSubscriptions.get(selectedIndex);
+            args.putInt(PhoneConstants.SUBSCRIPTION_KEY, subscription.getSubscriptionId());
+        }
+        ((SettingsActivity) getActivity()).startPreferencePanel(ResetNetworkConfirm.class.getName(),
+                args, R.string.reset_network_confirm_title, null, null, 0);
+    }
+
+    /**
+     * If the user clicks to begin the reset sequence, we next require a
+     * keyguard confirmation if the user has currently enabled one.  If there
+     * is no keyguard available, we simply go to the final confirmation prompt.
+     */
+    private final Button.OnClickListener mInitiateListener = new Button.OnClickListener() {
+
+        @Override
+        public void onClick(View v) {
+            if (!runKeyguardConfirmation(KEYGUARD_REQUEST)) {
+                showFinalConfirmation();
+            }
+        }
+    };
+
+    /**
+     * In its initial state, the activity presents a button for the user to
+     * click in order to initiate a confirmation sequence.  This method is
+     * called from various other points in the code to reset the activity to
+     * this base state.
+     *
+     * <p>Reinflating views from resources is expensive and prevents us from
+     * caching widget pointers, so we use a single-inflate pattern:  we lazy-
+     * inflate each view, caching all of the widget pointers we'll need at the
+     * time, then simply reuse the inflated views directly whenever we need
+     * to change contents.
+     */
+    private void establishInitialState() {
+        mSubscriptionSpinner = (Spinner) mContentView.findViewById(R.id.reset_network_subscription);
+
+        mSubscriptions = SubscriptionManager.from(getActivity()).getActiveSubscriptionInfoList();
+        if (mSubscriptions.size() > 0) {
+            // Get the default subscription in the order of data, voice, sms, first up.
+            int defaultSubscription = SubscriptionManager.getDefaultDataSubId();
+            if (!SubscriptionManager.isUsableSubIdValue(defaultSubscription)) {
+                defaultSubscription = SubscriptionManager.getDefaultVoiceSubId();
+            }
+            if (!SubscriptionManager.isUsableSubIdValue(defaultSubscription)) {
+                defaultSubscription = SubscriptionManager.getDefaultSmsSubId();
+            }
+            if (!SubscriptionManager.isUsableSubIdValue(defaultSubscription)) {
+                defaultSubscription = SubscriptionManager.getDefaultSubId();
+            }
+
+            int selectedIndex = 0;
+            int size = mSubscriptions.size();
+            List<String> subscriptionNames = new ArrayList<>();
+            for (SubscriptionInfo record : mSubscriptions) {
+                if (record.getSubscriptionId() == defaultSubscription) {
+                    // Set the first selected value to the default
+                    selectedIndex = subscriptionNames.size();
+                }
+                String name = record.getDisplayName().toString();
+                if (TextUtils.isEmpty(name)) {
+                    name = record.getNumber();
+                }
+                if (TextUtils.isEmpty(name)) {
+                    name = record.getCarrierName().toString();
+                }
+                if (TextUtils.isEmpty(name)) {
+                    name = String.format("MCC:%s MNC:%s Slot:%s Id:%s", record.getMcc(),
+                            record.getMnc(), record.getSimSlotIndex(), record.getSubscriptionId());
+                }
+                subscriptionNames.add(name);
+            }
+            ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(),
+                    android.R.layout.simple_spinner_item, subscriptionNames);
+            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+            mSubscriptionSpinner.setAdapter(adapter);
+            mSubscriptionSpinner.setSelection(selectedIndex);
+            mSubscriptionSpinner.setVisibility(View.VISIBLE);
+        } else {
+            mSubscriptionSpinner.setVisibility(View.INVISIBLE);
+        }
+        mInitiateButton = (Button) mContentView.findViewById(R.id.initiate_reset_network);
+        mInitiateButton.setOnClickListener(mInitiateListener);
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+            Bundle savedInstanceState) {
+        mContentView = inflater.inflate(R.layout.reset_network, null);
+
+        establishInitialState();
+        return mContentView;
+    }
+}
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
new file mode 100644
index 0000000..28fd92d
--- /dev/null
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2015 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;
+
+import android.app.Fragment;
+import android.content.Context;
+import android.net.IConnectivityManager;
+import android.net.NetworkPolicy;
+import android.net.NetworkPolicyManager;
+import android.net.NetworkTemplate;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyManager;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.Spinner;
+import android.widget.Toast;
+
+import com.android.internal.net.VpnConfig;
+import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
+import com.android.internal.telephony.PhoneFactory;
+import com.android.settings.net.NetworkPolicyEditor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Confirm and execute a reset of the network settings to a clean "just out of the box"
+ * state.  Multiple confirmations are required: first, a general "are you sure
+ * you want to do this?" prompt, followed by a keyguard pattern trace if the user
+ * has defined one, followed by a final strongly-worded "THIS WILL RESET EVERYTHING"
+ * prompt.  If at any time the phone is allowed to go to sleep, is
+ * locked, et cetera, then the confirmation sequence is abandoned.
+ *
+ * This is the confirmation screen.
+ */
+public class ResetNetworkConfirm extends Fragment {
+
+    private View mContentView;
+    private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+
+    /**
+     * The user has gone through the multiple confirmation, so now we go ahead
+     * and reset the network settings to its factory-default state.
+     */
+    private Button.OnClickListener mFinalClickListener = new Button.OnClickListener() {
+
+        @Override
+        public void onClick(View v) {
+            if (Utils.isMonkeyRunning()) {
+                return;
+            }
+            // TODO maybe show a progress dialog if this ends up taking a while
+
+            IConnectivityManager connectivityService = IConnectivityManager.Stub.asInterface(
+                    ServiceManager.getService(Context.CONNECTIVITY_SERVICE));
+            WifiManager wifiManager = (WifiManager)
+                    getActivity().getSystemService(Context.WIFI_SERVICE);
+            TelephonyManager telephonyManager = (TelephonyManager)
+                    getActivity().getSystemService(Context.TELEPHONY_SERVICE);
+            NetworkPolicyManager policyManager = NetworkPolicyManager.from(getActivity());
+            NetworkPolicyEditor policyEditor = new NetworkPolicyEditor(policyManager);
+            policyEditor.read();
+
+            // Turn airplane mode off
+            try {
+                connectivityService.setAirplaneMode(false);
+            } catch (RemoteException e) {
+                // Well, we tried
+            }
+
+            // Turn wifi on
+            wifiManager.setWifiEnabled(true);
+
+            // Delete all Wifi SSIDs
+            List<WifiConfiguration> networks = wifiManager.getConfiguredNetworks();
+            if (networks != null) {
+                for (WifiConfiguration config : networks) {
+                    wifiManager.removeNetwork(config.networkId);
+                }
+            }
+
+            // Turn mobile hotspot off
+            wifiManager.setWifiApEnabled(null, false);
+
+            // Un-tether
+            try {
+                for (String tether : connectivityService.getTetheredIfaces()) {
+                    connectivityService.untether(tether);
+                }
+            } catch (RemoteException e) {
+                // Well, we tried
+            }
+
+            // Turn VPN off
+            try {
+                VpnConfig vpnConfig = connectivityService.getVpnConfig();
+                if (vpnConfig != null) {
+                    if (vpnConfig.legacy) {
+                        connectivityService.prepareVpn(VpnConfig.LEGACY_VPN, VpnConfig.LEGACY_VPN);
+                    } else {
+                        // Prevent this app from initiating VPN connections in the future without
+                        // user intervention.
+                        connectivityService.setVpnPackageAuthorization(false);
+                        connectivityService.prepareVpn(vpnConfig.user, VpnConfig.LEGACY_VPN);
+                    }
+                }
+            } catch (RemoteException e) {
+                // Well, we tried
+            }
+
+            if (SubscriptionManager.isUsableSubIdValue(mSubId)) {
+                int phoneId = SubscriptionManager.getPhoneId(mSubId);
+                Phone phone = PhoneFactory.getPhone(phoneId);
+
+                // Turn mobile data on
+                phone.setDataEnabled(true);
+
+                // Set mobile network selection mode to automatic
+                phone.setNetworkSelectionModeAutomatic(null);
+
+                // Set preferred mobile network type to manufacturer's recommended
+                // int networkType = ; // TODO get manufacturer's default
+                // phone.setPreferredNetworkType(networkType, null);
+
+                // Turn roaming to manufacturer's default
+                // boolean enabled = ; // TODO get manufacturer's default
+                // phone.setDataRoamingEnabled(enabled);
+
+                String subscriberId = telephonyManager.getSubscriberId(mSubId);
+                NetworkTemplate template = NetworkTemplate.buildTemplateMobileAll(subscriberId);
+                // Turn mobile data limit off
+                policyEditor.setPolicyLimitBytes(template, NetworkPolicy.LIMIT_DISABLED);
+            }
+
+            // Turn restrict background data off
+            policyManager.setRestrictBackground(false);
+
+            // Remove app's "restrict background data" flag
+            for (int uid : policyManager.getUidsWithPolicy(
+                    NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND)) {
+                policyManager.setUidPolicy(uid, NetworkPolicyManager.POLICY_NONE);
+            }
+
+            Toast.makeText(getActivity(), R.string.reset_network_complete_toast, Toast.LENGTH_SHORT)
+                    .show();
+        }
+    };
+
+    /**
+     * Configure the UI for the final confirmation interaction
+     */
+    private void establishFinalConfirmationState() {
+        mContentView.findViewById(R.id.execute_reset_network)
+                .setOnClickListener(mFinalClickListener);
+    }
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+            Bundle savedInstanceState) {
+        mContentView = inflater.inflate(R.layout.reset_network_confirm, null);
+        establishFinalConfirmationState();
+        return mContentView;
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        Bundle args = getArguments();
+        if (args != null) {
+            mSubId = args.getInt(PhoneConstants.SUBSCRIPTION_KEY,
+                    SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+        }
+    }
+}
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 053e7f0..1f6d50a 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -39,7 +39,6 @@
 import android.preference.PreferenceScreen;
 import android.provider.SearchIndexableResource;
 import android.provider.Settings;
-import android.provider.Settings.SettingNotFoundException;
 import android.security.KeyStore;
 import android.service.fingerprint.FingerprintManager;
 import android.service.fingerprint.FingerprintManager.FingerprintItem;
diff --git a/src/com/android/settings/SelectableEditTextPreference.java b/src/com/android/settings/SelectableEditTextPreference.java
index 503db13..c14709f 100644
--- a/src/com/android/settings/SelectableEditTextPreference.java
+++ b/src/com/android/settings/SelectableEditTextPreference.java
@@ -18,7 +18,6 @@
 
 import android.content.Context;
 import android.preference.EditTextPreference;
-import android.preference.ListPreference;
 import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.view.View;
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index db080c6..11f7a1f 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -43,7 +43,6 @@
 import android.os.ServiceManager;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.os.storage.StorageManager;
 import android.preference.Preference;
 import android.preference.PreferenceFragment;
 import android.preference.PreferenceManager;
@@ -112,8 +111,6 @@
 import com.android.settings.wifi.SavedAccessPointsWifiSettings;
 import com.android.settings.wifi.WifiSettings;
 import com.android.settings.wifi.p2p.WifiP2pSettings;
-import com.android.settings.WifiCallingSettings;
-
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
diff --git a/src/com/android/settings/SetupChooseLockGeneric.java b/src/com/android/settings/SetupChooseLockGeneric.java
index f29f08a..10bac15 100644
--- a/src/com/android/settings/SetupChooseLockGeneric.java
+++ b/src/com/android/settings/SetupChooseLockGeneric.java
@@ -24,7 +24,6 @@
 import android.content.res.Resources;
 import android.os.Bundle;
 import android.preference.PreferenceFragment;
-import android.util.MutableBoolean;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java
index 3d44125..c35bb15 100644
--- a/src/com/android/settings/SetupWizardUtils.java
+++ b/src/com/android/settings/SetupWizardUtils.java
@@ -26,7 +26,6 @@
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.LayerDrawable;
-import android.view.Gravity;
 import android.view.Window;
 import android.widget.TextView;
 
diff --git a/src/com/android/settings/SmsDefaultDialog.java b/src/com/android/settings/SmsDefaultDialog.java
index 3a3848b..e2a3faf 100644
--- a/src/com/android/settings/SmsDefaultDialog.java
+++ b/src/com/android/settings/SmsDefaultDialog.java
@@ -20,8 +20,6 @@
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
 import android.os.Bundle;
 import android.provider.Telephony.Sms.Intents;
 import android.telephony.TelephonyManager;
diff --git a/src/com/android/settings/TestingSettingsBroadcastReceiver.java b/src/com/android/settings/TestingSettingsBroadcastReceiver.java
index 3c40453..37e0b50 100644
--- a/src/com/android/settings/TestingSettingsBroadcastReceiver.java
+++ b/src/com/android/settings/TestingSettingsBroadcastReceiver.java
@@ -1,13 +1,10 @@
 package com.android.settings;
 
-import android.provider.Telephony;
 import static com.android.internal.telephony.TelephonyIntents.SECRET_CODE_ACTION;
 
 import android.content.Context;
 import android.content.Intent;
 import android.content.BroadcastReceiver;
-import android.util.Log;
-import android.view.KeyEvent;
 
 
 public class TestingSettingsBroadcastReceiver extends BroadcastReceiver {
diff --git a/src/com/android/settings/TetherService.java b/src/com/android/settings/TetherService.java
index 03bcc83..459dc27 100644
--- a/src/com/android/settings/TetherService.java
+++ b/src/com/android/settings/TetherService.java
@@ -30,13 +30,11 @@
 import android.content.IntentFilter;
 import android.content.SharedPreferences;
 import android.net.ConnectivityManager;
-import android.net.wifi.WifiManager;
 import android.os.IBinder;
 import android.os.SystemClock;
 import android.text.TextUtils;
 import android.util.Log;
 
-import com.android.settings.wifi.WifiApEnabler;
 import com.android.settingslib.TetherUtil;
 
 import java.util.ArrayList;
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
index 393adf6..ca1e8ec 100644
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -38,8 +38,6 @@
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.os.Environment;
-import android.os.SystemProperties;
-import android.os.UserHandle;
 import android.os.UserManager;
 import android.preference.Preference;
 import android.preference.PreferenceScreen;
diff --git a/src/com/android/settings/TrustedCredentialsSettings.java b/src/com/android/settings/TrustedCredentialsSettings.java
index 95a6bf4..753afc7 100644
--- a/src/com/android/settings/TrustedCredentialsSettings.java
+++ b/src/com/android/settings/TrustedCredentialsSettings.java
@@ -22,7 +22,6 @@
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.pm.UserInfo;
-import android.content.res.TypedArray;
 import android.net.http.SslCertificate;
 import android.os.AsyncTask;
 import android.os.Bundle;
diff --git a/src/com/android/settings/UsageAccessSettings.java b/src/com/android/settings/UsageAccessSettings.java
index fd98b51..362d27f 100644
--- a/src/com/android/settings/UsageAccessSettings.java
+++ b/src/com/android/settings/UsageAccessSettings.java
@@ -17,8 +17,6 @@
 package com.android.settings;
 
 import com.android.internal.content.PackageMonitor;
-import com.android.settings.DataUsageSummary.AppItem;
-
 import android.Manifest;
 import android.app.ActivityThread;
 import android.app.AlertDialog;
@@ -43,7 +41,6 @@
 import android.preference.PreferenceScreen;
 import android.preference.SwitchPreference;
 import android.util.ArrayMap;
-import android.util.AttributeSet;
 import android.util.Log;
 import android.util.SparseArray;
 
diff --git a/src/com/android/settings/UserSpinnerAdapter.java b/src/com/android/settings/UserSpinnerAdapter.java
index 5e2b16f..e40a374 100644
--- a/src/com/android/settings/UserSpinnerAdapter.java
+++ b/src/com/android/settings/UserSpinnerAdapter.java
@@ -18,7 +18,6 @@
 
 import android.content.Context;
 import android.content.pm.UserInfo;
-import android.content.res.Resources;
 import android.database.DataSetObserver;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index 71cd322..d94b8a7 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -47,7 +47,6 @@
 import android.text.TextUtils;
 import android.util.Log;
 
-import com.android.ims.ImsConfig;
 import com.android.ims.ImsManager;
 import com.android.internal.telephony.SmsApplication;
 import com.android.internal.telephony.SmsApplication.SmsApplicationData;
@@ -56,8 +55,6 @@
 import com.android.settings.nfc.NfcEnabler;
 import com.android.settings.search.BaseSearchIndexProvider;
 import com.android.settings.search.Indexable;
-import com.android.settings.WifiCallingSettings;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
diff --git a/src/com/android/settings/ZonePicker.java b/src/com/android/settings/ZonePicker.java
index 0a9173f..72e4a03 100644
--- a/src/com/android/settings/ZonePicker.java
+++ b/src/com/android/settings/ZonePicker.java
@@ -46,7 +46,6 @@
 import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
-import libcore.icu.ICU;
 import libcore.icu.TimeZoneNames;
 
 /**
diff --git a/src/com/android/settings/accessibility/AccessibilitySettings.java b/src/com/android/settings/accessibility/AccessibilitySettings.java
index 7d51712..f0464ab 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettings.java
@@ -41,10 +41,7 @@
 import android.text.TextUtils.SimpleStringSplitter;
 import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
-import android.view.View;
 import android.view.accessibility.AccessibilityManager;
-import android.widget.TextView;
-
 import com.android.internal.content.PackageMonitor;
 import com.android.internal.view.RotationPolicy;
 import com.android.internal.view.RotationPolicy.RotationPolicyListener;
diff --git a/src/com/android/settings/accessibility/LocalePreference.java b/src/com/android/settings/accessibility/LocalePreference.java
index 0a94817..10e94a8 100644
--- a/src/com/android/settings/accessibility/LocalePreference.java
+++ b/src/com/android/settings/accessibility/LocalePreference.java
@@ -17,17 +17,13 @@
 package com.android.settings.accessibility;
 
 import android.content.Context;
-import android.content.res.Resources;
 import android.preference.ListPreference;
 import android.util.AttributeSet;
 
 import com.android.internal.app.LocalePicker;
 import com.android.settings.R;
 
-import java.text.Collator;
-import java.util.Arrays;
 import java.util.List;
-import java.util.Locale;
 
 /**
  * List preference that allows the user to pick a locale from the list of
diff --git a/src/com/android/settings/accounts/ProviderPreference.java b/src/com/android/settings/accounts/ProviderPreference.java
index 3996523..257cd1c 100644
--- a/src/com/android/settings/accounts/ProviderPreference.java
+++ b/src/com/android/settings/accounts/ProviderPreference.java
@@ -16,13 +16,9 @@
 
 package com.android.settings.accounts;
 
-import com.android.settings.R;
-
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.preference.Preference;
-import android.view.View;
-import android.widget.ImageView;
 
 /**
  * ProviderPreference is used to display an image to the left of a provider name.
diff --git a/src/com/android/settings/applications/AppViewHolder.java b/src/com/android/settings/applications/AppViewHolder.java
index d23f187..c4324d1 100644
--- a/src/com/android/settings/applications/AppViewHolder.java
+++ b/src/com/android/settings/applications/AppViewHolder.java
@@ -2,7 +2,6 @@
 
 import com.android.settings.R;
 
-import android.content.Context;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
diff --git a/src/com/android/settings/applications/ApplicationsState.java b/src/com/android/settings/applications/ApplicationsState.java
index 3f25d47..3825296 100644
--- a/src/com/android/settings/applications/ApplicationsState.java
+++ b/src/com/android/settings/applications/ApplicationsState.java
@@ -12,7 +12,6 @@
 import android.content.pm.PackageManager;
 import android.content.pm.PackageStats;
 import android.content.pm.ParceledListSlice;
-import android.content.pm.UserInfo;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
 import android.os.Handler;
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
index 0152755..f40bfdc 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -44,7 +44,6 @@
 import android.os.RemoteException;
 import android.os.ServiceManager;
 import android.os.UserHandle;
-import android.os.UserManager;
 import android.preference.PreferenceFrameLayout;
 import android.provider.Settings;
 import android.support.v4.view.PagerAdapter;
@@ -61,7 +60,6 @@
 import android.widget.AbsListView;
 import android.widget.AdapterView;
 import android.widget.AdapterView.OnItemClickListener;
-import android.widget.AdapterView.OnItemSelectedListener;
 import android.widget.BaseAdapter;
 import android.widget.Filter;
 import android.widget.Filterable;
@@ -73,7 +71,6 @@
 import com.android.settings.R;
 import com.android.settings.Settings.RunningServicesActivity;
 import com.android.settings.Settings.StorageUseActivity;
-import com.android.settings.UserSpinnerAdapter;
 import com.android.settings.Utils;
 import com.android.settings.applications.ApplicationsState.AppEntry;
 import com.android.settings.deviceinfo.StorageMeasurement;
diff --git a/src/com/android/settings/applications/ProcStatsEntry.java b/src/com/android/settings/applications/ProcStatsEntry.java
index 6cb6997..41f7a53 100644
--- a/src/com/android/settings/applications/ProcStatsEntry.java
+++ b/src/com/android/settings/applications/ProcStatsEntry.java
@@ -17,11 +17,9 @@
 package com.android.settings.applications;
 
 import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.os.Parcel;
 import android.os.Parcelable;
-import android.os.Process;
 import android.util.ArrayMap;
 import android.util.Log;
 import android.util.SparseArray;
diff --git a/src/com/android/settings/applications/ProcessStatsPreference.java b/src/com/android/settings/applications/ProcessStatsPreference.java
index a0839d3..182cf0e 100644
--- a/src/com/android/settings/applications/ProcessStatsPreference.java
+++ b/src/com/android/settings/applications/ProcessStatsPreference.java
@@ -26,7 +26,6 @@
 import android.widget.ProgressBar;
 import android.widget.TextView;
 import com.android.settings.R;
-import com.android.settings.Utils;
 
 public class ProcessStatsPreference extends Preference {
     private ProcStatsPackageEntry mEntry;
diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
index 0bb54b2..7bdc1a6 100644
--- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
@@ -21,7 +21,6 @@
 import android.app.AlertDialog;
 import android.bluetooth.BluetoothClass;
 import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothProfile;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.os.UserManager;
@@ -37,9 +36,7 @@
 import com.android.settings.R;
 import com.android.settings.search.Index;
 import com.android.settings.search.SearchIndexableRaw;
-import com.android.settingslib.bluetooth.A2dpProfile;
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
-import com.android.settingslib.bluetooth.HeadsetProfile;
 import com.android.settingslib.bluetooth.HidProfile;
 import com.android.settingslib.bluetooth.LocalBluetoothProfile;
 
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
index 5b54c32..5785285 100755
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialog.java
@@ -17,19 +17,16 @@
 package com.android.settings.bluetooth;
 
 import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothUuid;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.os.Bundle;
-import android.os.ParcelUuid;
 import android.text.Editable;
 import android.text.Html;
 import android.text.InputFilter;
 import android.text.InputType;
-import android.text.Spanned;
 import android.text.TextWatcher;
 import android.text.InputFilter.LengthFilter;
 import android.util.Log;
diff --git a/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java b/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
index f07a9f2..cc98c7b 100644
--- a/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
+++ b/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
@@ -16,12 +16,8 @@
 
 package com.android.settings.bluetooth;
 
-import android.app.Activity;
 import android.bluetooth.BluetoothAdapter;
 import android.bluetooth.BluetoothDevice;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
 import android.os.Bundle;
 import android.preference.Preference;
 import android.preference.PreferenceCategory;
diff --git a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
index 89287ab..e563e64 100755
--- a/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
+++ b/src/com/android/settings/bluetooth/DeviceProfilesSettings.java
@@ -17,7 +17,6 @@
 package com.android.settings.bluetooth;
 
 import android.app.AlertDialog;
-import android.app.Fragment;
 import android.bluetooth.BluetoothDevice;
 import android.bluetooth.BluetoothProfile;
 import android.content.Context;
@@ -27,21 +26,12 @@
 import android.preference.EditTextPreference;
 import android.preference.Preference;
 import android.preference.PreferenceGroup;
-import android.preference.PreferenceScreen;
 import android.text.Html;
 import android.text.TextUtils;
 import android.util.Log;
-import android.view.View;
 import android.widget.EditText;
-import android.text.TextWatcher;
-import android.app.Dialog;
-import android.widget.Button;
-import android.text.Editable;
-
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.search.Index;
-import com.android.settings.search.SearchIndexableRaw;
 import com.android.settingslib.bluetooth.CachedBluetoothDevice;
 import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
diff --git a/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java b/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java
index 87a73a7..c30113e 100644
--- a/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java
+++ b/src/com/android/settings/bluetooth/RequestPermissionHelperActivity.java
@@ -22,14 +22,11 @@
 import com.android.settingslib.bluetooth.LocalBluetoothAdapter;
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
 
-import android.app.Activity;
 import android.bluetooth.BluetoothAdapter;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
 import android.util.Log;
-import android.view.View;
-import android.widget.TextView;
 
 /**
  * RequestPermissionHelperActivity asks the user whether to enable discovery.
diff --git a/src/com/android/settings/dashboard/DashboardCategory.java b/src/com/android/settings/dashboard/DashboardCategory.java
index 164d988..fedbf0a 100644
--- a/src/com/android/settings/dashboard/DashboardCategory.java
+++ b/src/com/android/settings/dashboard/DashboardCategory.java
@@ -19,7 +19,6 @@
 import android.content.res.Resources;
 import android.os.Parcel;
 import android.os.Parcelable;
-import android.os.Parcelable.Creator;
 import android.text.TextUtils;
 
 import java.util.ArrayList;
diff --git a/src/com/android/settings/deviceinfo/ImeiInformation.java b/src/com/android/settings/deviceinfo/ImeiInformation.java
index 253e22a..37b6c1d 100644
--- a/src/com/android/settings/deviceinfo/ImeiInformation.java
+++ b/src/com/android/settings/deviceinfo/ImeiInformation.java
@@ -24,14 +24,10 @@
 import android.preference.Preference;
 import android.preference.PreferenceActivity;
 import android.preference.PreferenceScreen;
-import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
-import android.util.Log;
-
 import com.android.settings.R;
-import java.util.List;
 
 public class ImeiInformation extends PreferenceActivity {
 
diff --git a/src/com/android/settings/deviceinfo/SimStatus.java b/src/com/android/settings/deviceinfo/SimStatus.java
index db3a491..e50d0d9 100644
--- a/src/com/android/settings/deviceinfo/SimStatus.java
+++ b/src/com/android/settings/deviceinfo/SimStatus.java
@@ -22,9 +22,6 @@
 import android.content.IntentFilter;
 import android.content.res.Resources;
 import android.os.Bundle;
-import android.os.ServiceManager;
-import android.os.RemoteException;
-import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.preference.Preference;
 import android.preference.PreferenceActivity;
@@ -36,11 +33,9 @@
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
-import android.provider.Telephony;
 import android.text.TextUtils;
 import android.util.Log;
 
-import com.android.internal.telephony.ITelephony;
 import com.android.internal.telephony.DefaultPhoneNotifier;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneFactory;
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java
index 2c92973..646792c 100644
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -24,7 +24,6 @@
 import android.content.IntentFilter;
 import android.content.res.Resources;
 import android.net.ConnectivityManager;
-import android.net.NetworkInfo;
 import android.net.wifi.WifiInfo;
 import android.net.wifi.WifiManager;
 import android.os.Build;
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java b/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java
index e7326b1..b615ffd 100644
--- a/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java
+++ b/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java
@@ -18,14 +18,10 @@
 
 import android.content.Context;
 import android.content.Intent;
-import android.graphics.drawable.Drawable;
 import android.os.BatteryStats;
 import android.preference.Preference;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
 import com.android.settings.R;
 
 /**
diff --git a/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java b/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java
index 645695e..3562cb4 100644
--- a/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java
+++ b/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java
@@ -16,7 +16,6 @@
 
 package com.android.settings.inputmethod;
 
-import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
 
 import android.content.Context;
diff --git a/src/com/android/settings/inputmethod/UserDictionaryLocalePicker.java b/src/com/android/settings/inputmethod/UserDictionaryLocalePicker.java
index b9ccdfd..c3c4237 100644
--- a/src/com/android/settings/inputmethod/UserDictionaryLocalePicker.java
+++ b/src/com/android/settings/inputmethod/UserDictionaryLocalePicker.java
@@ -16,8 +16,6 @@
 
 package com.android.settings.inputmethod;
 
-import java.util.Locale;
-
 public class UserDictionaryLocalePicker extends com.android.internal.app.LocalePicker {
     public UserDictionaryLocalePicker(final UserDictionaryAddWordFragment parent) {
         super();
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
index ba5cd92..1ed2ece 100644
--- a/src/com/android/settings/location/LocationSettings.java
+++ b/src/com/android/settings/location/LocationSettings.java
@@ -21,7 +21,6 @@
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.location.SettingInjectorService;
-import android.os.Binder;
 import android.os.Bundle;
 import android.os.UserHandle;
 import android.os.UserManager;
@@ -29,8 +28,6 @@
 import android.preference.PreferenceCategory;
 import android.preference.PreferenceGroup;
 import android.preference.PreferenceScreen;
-import android.preference.SwitchPreference;
-import android.provider.Settings;
 import android.util.Log;
 import android.widget.Switch;
 
diff --git a/src/com/android/settings/location/RecentLocationApps.java b/src/com/android/settings/location/RecentLocationApps.java
index c134889..d7b62e7 100644
--- a/src/com/android/settings/location/RecentLocationApps.java
+++ b/src/com/android/settings/location/RecentLocationApps.java
@@ -31,9 +31,6 @@
 import android.os.UserManager;
 import android.preference.Preference;
 import android.util.Log;
-import android.view.View;
-import android.widget.TextView;
-
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
 import com.android.settings.applications.InstalledAppDetails;
diff --git a/src/com/android/settings/location/SettingsInjector.java b/src/com/android/settings/location/SettingsInjector.java
index f0a0ff3..ef6117b 100644
--- a/src/com/android/settings/location/SettingsInjector.java
+++ b/src/com/android/settings/location/SettingsInjector.java
@@ -39,8 +39,6 @@
 import android.util.Log;
 import android.util.Xml;
 
-import com.android.settings.R;
-
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java
index 67a8074..bad43cc 100644
--- a/src/com/android/settings/notification/AppNotificationSettings.java
+++ b/src/com/android/settings/notification/AppNotificationSettings.java
@@ -29,11 +29,6 @@
 import android.text.TextUtils;
 import android.util.ArrayMap;
 import android.util.Log;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
 import android.widget.Toast;
 
 import com.android.internal.widget.LockPatternUtils;
diff --git a/src/com/android/settings/print/PrintJobSettingsFragment.java b/src/com/android/settings/print/PrintJobSettingsFragment.java
index ccdfc0e..978e4d6 100644
--- a/src/com/android/settings/print/PrintJobSettingsFragment.java
+++ b/src/com/android/settings/print/PrintJobSettingsFragment.java
@@ -16,7 +16,6 @@
 
 package com.android.settings.print;
 
-import android.app.ActivityManager;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
diff --git a/src/com/android/settings/print/PrintSettingsFragment.java b/src/com/android/settings/print/PrintSettingsFragment.java
index 581321b..3e989e4 100644
--- a/src/com/android/settings/print/PrintSettingsFragment.java
+++ b/src/com/android/settings/print/PrintSettingsFragment.java
@@ -16,7 +16,6 @@
 
 package com.android.settings.print;
 
-import android.app.ActivityManager;
 import android.app.LoaderManager.LoaderCallbacks;
 import android.content.AsyncTaskLoader;
 import android.content.ComponentName;
@@ -33,7 +32,6 @@
 import android.os.Message;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.os.Process;
 import android.preference.Preference;
 import android.preference.PreferenceCategory;
 import android.preference.PreferenceScreen;
@@ -58,7 +56,6 @@
 
 import com.android.internal.content.PackageMonitor;
 import com.android.settings.UserSpinnerAdapter;
-import com.android.settings.UserSpinnerAdapter.UserDetails;
 import com.android.settings.DialogCreatable;
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java
index e9234d7..97762c4 100644
--- a/src/com/android/settings/sim/SimDialogActivity.java
+++ b/src/com/android/settings/sim/SimDialogActivity.java
@@ -19,7 +19,6 @@
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
-import android.content.ComponentName;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.res.Resources;
@@ -30,8 +29,6 @@
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
-import android.text.TextUtils;
-import android.util.Log;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -44,9 +41,6 @@
 
 import com.android.settings.R;
 import com.android.settings.Utils;
-import com.android.internal.telephony.Phone;
-import com.android.internal.telephony.PhoneFactory;
-
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index b16ab56..fa61aec 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -28,7 +28,6 @@
 import android.content.ActivityNotFoundException;
 import android.content.ContentResolver;
 import android.content.Intent;
-import android.os.AsyncTask;
 import android.os.Bundle;
 import android.preference.ListPreference;
 import android.preference.Preference;
diff --git a/src/com/android/settings/users/AppRestrictionsFragment.java b/src/com/android/settings/users/AppRestrictionsFragment.java
index 53fdf1b..74ee6d9 100644
--- a/src/com/android/settings/users/AppRestrictionsFragment.java
+++ b/src/com/android/settings/users/AppRestrictionsFragment.java
@@ -31,7 +31,6 @@
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
-import android.graphics.Bitmap;
 import android.graphics.drawable.Drawable;
 import android.os.AsyncTask;
 import android.os.Bundle;
@@ -60,8 +59,6 @@
 import com.android.settings.R;
 import com.android.settings.SettingsPreferenceFragment;
 import com.android.settings.Utils;
-import com.android.settings.drawable.CircleFramedDrawable;
-
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
diff --git a/src/com/android/settings/users/ProfileUpdateReceiver.java b/src/com/android/settings/users/ProfileUpdateReceiver.java
index 955ee4d..69484f7 100644
--- a/src/com/android/settings/users/ProfileUpdateReceiver.java
+++ b/src/com/android/settings/users/ProfileUpdateReceiver.java
@@ -22,8 +22,6 @@
 import android.content.SharedPreferences;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.provider.ContactsContract.CommonDataKinds.Phone;
-
 import com.android.settings.Utils;
 
 
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index e54ea9f..ff06b69 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -56,7 +56,6 @@
 import android.view.View.OnClickListener;
 import android.widget.SimpleAdapter;
 
-import com.android.internal.util.UserIcons;
 import com.android.internal.widget.LockPatternUtils;
 import com.android.settings.ChooseLockGeneric;
 import com.android.settings.OwnerInfoSettings;
diff --git a/src/com/android/settings/vpn2/VpnDialog.java b/src/com/android/settings/vpn2/VpnDialog.java
index 9ef269b..2f95bce 100644
--- a/src/com/android/settings/vpn2/VpnDialog.java
+++ b/src/com/android/settings/vpn2/VpnDialog.java
@@ -31,7 +31,6 @@
 import android.view.WindowManager;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
-import android.widget.Button;
 import android.widget.CheckBox;
 import android.widget.Spinner;
 import android.widget.TextView;
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java
index 7516392..c6c3546 100644
--- a/src/com/android/settings/vpn2/VpnSettings.java
+++ b/src/com/android/settings/vpn2/VpnSettings.java
@@ -45,10 +45,8 @@
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.AdapterView.OnItemSelectedListener;
 import android.widget.ArrayAdapter;
 import android.widget.ListView;
-import android.widget.Spinner;
 import android.widget.TextView;
 import android.widget.Toast;
 
diff --git a/src/com/android/settings/wfd/WifiDisplaySettings.java b/src/com/android/settings/wfd/WifiDisplaySettings.java
index fdaa042..9f3ac82 100755
--- a/src/com/android/settings/wfd/WifiDisplaySettings.java
+++ b/src/com/android/settings/wfd/WifiDisplaySettings.java
@@ -16,8 +16,6 @@
 
 package com.android.settings.wfd;
 
-import android.app.ActionBar;
-import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Service;
 import android.content.BroadcastReceiver;
diff --git a/src/com/android/settings/widget/ChartGridView.java b/src/com/android/settings/widget/ChartGridView.java
index 4cd6f5f..b9516ab 100644
--- a/src/com/android/settings/widget/ChartGridView.java
+++ b/src/com/android/settings/widget/ChartGridView.java
@@ -29,15 +29,11 @@
 import android.text.StaticLayout;
 import android.text.TextPaint;
 import android.util.AttributeSet;
-import android.util.Log;
-import android.util.TypedValue;
 import android.view.View;
 
 import com.android.internal.util.Preconditions;
 import com.android.settings.R;
 
-import java.util.Locale;
-
 /**
  * Background of {@link ChartView} that renders grid lines as requested by
  * {@link ChartAxis#getTickPoints()}.
diff --git a/src/com/android/settings/widget/StickyHeaderListView.java b/src/com/android/settings/widget/StickyHeaderListView.java
index 3d9f158..a2ff51b 100644
--- a/src/com/android/settings/widget/StickyHeaderListView.java
+++ b/src/com/android/settings/widget/StickyHeaderListView.java
@@ -21,7 +21,6 @@
 import android.graphics.Canvas;
 import android.graphics.RectF;
 import android.util.AttributeSet;
-import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.WindowInsets;
diff --git a/src/com/android/settings/widget/SwitchBar.java b/src/com/android/settings/widget/SwitchBar.java
index c15ac41..606ceaa 100644
--- a/src/com/android/settings/widget/SwitchBar.java
+++ b/src/com/android/settings/widget/SwitchBar.java
@@ -21,7 +21,6 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.util.AttributeSet;
-import android.util.TypedValue;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/settings/wifi/WifiAPITest.java b/src/com/android/settings/wifi/WifiAPITest.java
index 4a9a075..1b5d875 100644
--- a/src/com/android/settings/wifi/WifiAPITest.java
+++ b/src/com/android/settings/wifi/WifiAPITest.java
@@ -20,7 +20,6 @@
 
 import android.app.AlertDialog;
 import android.content.DialogInterface;
-import android.content.Intent;
 import android.net.wifi.WifiManager;
 
 import android.os.Bundle;
diff --git a/src/com/android/settings/wifi/WifiScanModeActivity.java b/src/com/android/settings/wifi/WifiScanModeActivity.java
index 4133eb8..e495ddd 100644
--- a/src/com/android/settings/wifi/WifiScanModeActivity.java
+++ b/src/com/android/settings/wifi/WifiScanModeActivity.java
@@ -29,7 +29,6 @@
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.provider.Settings;
-import android.util.Log;
 
 /**
  * This activity requests users permission to allow scanning even when Wi-Fi is turned off
diff --git a/src/com/android/settings/wifi/WriteWifiConfigToNfcDialog.java b/src/com/android/settings/wifi/WriteWifiConfigToNfcDialog.java
index 87850e5..97f45aa 100644
--- a/src/com/android/settings/wifi/WriteWifiConfigToNfcDialog.java
+++ b/src/com/android/settings/wifi/WriteWifiConfigToNfcDialog.java
@@ -34,13 +34,11 @@
 import android.text.InputType;
 import android.text.TextWatcher;
 import android.util.Log;
-import android.view.Gravity;
 import android.view.View;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
 import android.widget.CheckBox;
 import android.widget.CompoundButton;
-import android.widget.LinearLayout;
 import android.widget.ProgressBar;
 import android.widget.TextView;