diff --git a/res/drawable/ic_translate_24dp.xml b/res/drawable/ic_translate_24dp.xml
new file mode 100644
index 0000000..4df035c
--- /dev/null
+++ b/res/drawable/ic_translate_24dp.xml
@@ -0,0 +1,26 @@
+<!--
+  Copyright (C) 2017 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.
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24dp"
+        android:height="24dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0"
+        android:tint="?android:attr/colorControlNormal">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M12.87,15.07l-2.54,-2.51 0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35 8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5 3.11,3.11 0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z"/>
+</vector>
diff --git a/res/layout-land/fingerprint_enroll_find_sensor.xml b/res/layout-land/fingerprint_enroll_find_sensor.xml
index a43534f..7877d98 100644
--- a/res/layout-land/fingerprint_enroll_find_sensor.xml
+++ b/res/layout-land/fingerprint_enroll_find_sensor.xml
@@ -42,7 +42,7 @@
 
             <LinearLayout
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
+                android:layout_height="match_parent"
                 android:orientation="vertical"
                 android:clipChildren="false"
                 android:clipToPadding="false">
@@ -52,6 +52,7 @@
                     style="@style/SuwGlifIcon"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
+                    android:layout_gravity="?attr/suwGlifHeaderGravity"
                     android:layout_marginStart="0dp"
                     android:layout_marginEnd="0dp"
                     android:src="@drawable/ic_fingerprint_header" />
@@ -70,13 +71,18 @@
                     android:layout_height="wrap_content"
                     android:text="@string/security_settings_fingerprint_enroll_find_sensor_message"/>
 
+                <Space
+                    android:layout_width="0dp"
+                    android:layout_height="0dp"
+                    android:layout_weight="1" />
+
                 <Button
-                    style="@style/SetupWizardButton.Positive"
-                    android:id="@+id/next_button"
+                    style="@style/SetupWizardButton.Negative"
+                    android:id="@+id/skip_button"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginTop="8dp"
-                    android:text="@string/fingerprint_enroll_button_next" />
+                    android:text="@string/skip_label" />
 
             </LinearLayout>
 
diff --git a/res/layout/choose_lock_password.xml b/res/layout/choose_lock_password.xml
index 02912ee..082d6c9 100644
--- a/res/layout/choose_lock_password.xml
+++ b/res/layout/choose_lock_password.xml
@@ -32,6 +32,13 @@
         android:gravity="center_horizontal"
         android:orientation="vertical">
 
+        <TextView
+            android:id="@+id/fingerprint_backup_message"
+            style="@style/SuwDescription.Glif"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:visibility="gone" />
+
         <LinearLayout
             android:id="@+id/password_container"
             android:layout_width="match_parent"
diff --git a/res/layout/fingerprint_enroll_find_sensor_base.xml b/res/layout/fingerprint_enroll_find_sensor_base.xml
index fa344ab..44455c5 100644
--- a/res/layout/fingerprint_enroll_find_sensor_base.xml
+++ b/res/layout/fingerprint_enroll_find_sensor_base.xml
@@ -17,10 +17,12 @@
 
 <com.android.setupwizardlib.GlifLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/setup_wizard_layout"
     style="?attr/fingerprint_layout_theme"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    app:suwFooter="@layout/fingerprint_enroll_find_sensor_base_footer">
 
     <FrameLayout
         android:layout_width="match_parent"
@@ -56,7 +58,7 @@
                 android:layout_weight="1"/>
 
             <Button
-                style="@style/SuwGlifButton.Primary"
+                style="@style/SuwGlifButton.Secondary"
                 android:id="@+id/next_button"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
diff --git a/res/layout/fingerprint_enroll_find_sensor_base_footer.xml b/res/layout/fingerprint_enroll_find_sensor_base_footer.xml
new file mode 100644
index 0000000..e93fae9
--- /dev/null
+++ b/res/layout/fingerprint_enroll_find_sensor_base_footer.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2017 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.
+-->
+
+<!-- TODO: Use aapt:attr when it is fixed (b/36809755) -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    style="@style/SuwGlifButtonBar"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <Button
+        style="@style/SuwGlifButton.Secondary"
+        android:id="@+id/skip_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/skip_label" />
+
+</LinearLayout>
diff --git a/res/xml/language_and_input.xml b/res/xml/language_and_input.xml
index 5ea8836..1cbeecd 100644
--- a/res/xml/language_and_input.xml
+++ b/res/xml/language_and_input.xml
@@ -23,6 +23,7 @@
     <Preference
         android:key="phone_language"
         android:title="@string/phone_language"
+        android:icon="@drawable/ic_translate_24dp"
         android:fragment="com.android.settings.localepicker.LocaleListEditor"/>
 
     <PreferenceCategory
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index f61dfd3..805f965 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -87,8 +87,6 @@
     private static final String SAVE_KEY_CATEGORIES = ":settings:categories";
     @VisibleForTesting
     static final String SAVE_KEY_SHOW_HOME_AS_UP = ":settings:show_home_as_up";
-    @VisibleForTesting
-    static final String SAVE_KEY_SHOW_SEARCH = ":settings:show_search";
 
     /**
      * When starting this activity, the invoking Intent can contain this extra
@@ -192,22 +190,18 @@
 
     private DynamicIndexableContentMonitor mDynamicIndexableContentMonitor;
 
-    private ActionBar mActionBar;
     private SwitchBar mSwitchBar;
 
     private Button mNextButton;
 
     @VisibleForTesting
     boolean mDisplayHomeAsUpEnabled;
-    @VisibleForTesting
-    boolean mDisplaySearch;
 
     private boolean mIsShowingDashboard;
     private boolean mIsShortcut;
 
     private ViewGroup mContent;
 
-    private SearchFeatureProvider mSearchFeatureProvider;
     private MetricsFeatureProvider mMetricsFeatureProvider;
 
     // Categories
@@ -233,15 +227,6 @@
     }
 
     @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        if (!mDisplaySearch) {
-            return false;
-        }
-        mSearchFeatureProvider.setUpSearchMenu(menu, this);
-        return true;
-    }
-
-    @Override
     public SharedPreferences getSharedPreferences(String name, int mode) {
         if (name.equals(getPackageName() + "_preferences")) {
             return new SharedPreferencesLogger(this, getMetricsTag());
@@ -284,7 +269,6 @@
         final FeatureFactory factory = FeatureFactory.getFactory(this);
 
         mDashboardFeatureProvider = factory.getDashboardFeatureProvider(this);
-        mSearchFeatureProvider = factory.getSearchFeatureProvider();
         mMetricsFeatureProvider = factory.getMetricsFeatureProvider();
 
         // Should happen before any call to getIntent()
@@ -324,7 +308,7 @@
         setContentView(mIsShowingDashboard ?
                 R.layout.settings_main_dashboard : R.layout.settings_main_prefs);
 
-        mContent = (ViewGroup) findViewById(R.id.main_content);
+        mContent = findViewById(R.id.main_content);
 
         getFragmentManager().addOnBackStackChangedListener(this);
 
@@ -355,12 +339,12 @@
             setActionBar(toolbar);
         }
 
-        mActionBar = getActionBar();
-        if (mActionBar != null) {
-            mActionBar.setDisplayHomeAsUpEnabled(mDisplayHomeAsUpEnabled);
-            mActionBar.setHomeButtonEnabled(mDisplayHomeAsUpEnabled);
+        ActionBar actionBar = getActionBar();
+        if (actionBar != null) {
+            actionBar.setDisplayHomeAsUpEnabled(mDisplayHomeAsUpEnabled);
+            actionBar.setHomeButtonEnabled(mDisplayHomeAsUpEnabled);
         }
-        mSwitchBar = (SwitchBar) findViewById(R.id.switch_bar);
+        mSwitchBar = findViewById(R.id.switch_bar);
         if (mSwitchBar != null) {
             mSwitchBar.setMetricsTag(getMetricsTag());
         }
@@ -427,7 +411,6 @@
     @VisibleForTesting
     void launchSettingFragment(String initialFragmentName, boolean isSubSettings, Intent intent) {
         if (!mIsShowingDashboard && initialFragmentName != null) {
-            mDisplaySearch = false;
             // UP will be shown only if it is a sub settings
             if (mIsShortcut) {
                 mDisplayHomeAsUpEnabled = isSubSettings;
@@ -444,8 +427,6 @@
         } else {
             // Show search icon as up affordance if we are displaying the main Dashboard
             mDisplayHomeAsUpEnabled = true;
-            // toolbar is search affordance so don't show search
-            mDisplaySearch = false;
             mInitialTitleResId = R.string.dashboard_title;
 
             switchToFragment(DashboardSummary.class.getName(), null /* args */, false, false,
@@ -453,13 +434,6 @@
         }
     }
 
-    public void setDisplaySearchMenu(boolean displaySearch) {
-        if (displaySearch != mDisplaySearch) {
-            mDisplaySearch = displaySearch;
-            invalidateOptionsMenu();
-        }
-    }
-
     private void setTitleFromIntent(Intent intent) {
         final int initialTitleResId = intent.getIntExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID, -1);
         if (initialTitleResId > 0) {
@@ -540,7 +514,6 @@
         }
 
         outState.putBoolean(SAVE_KEY_SHOW_HOME_AS_UP, mDisplayHomeAsUpEnabled);
-        outState.putBoolean(SAVE_KEY_SHOW_SEARCH, mDisplaySearch);
     }
 
     @Override
@@ -548,19 +521,13 @@
         super.onRestoreInstanceState(savedInstanceState);
 
         mDisplayHomeAsUpEnabled = savedInstanceState.getBoolean(SAVE_KEY_SHOW_HOME_AS_UP);
-        mDisplaySearch = savedInstanceState.getBoolean(SAVE_KEY_SHOW_SEARCH);
     }
 
     @Override
     protected void onResume() {
         super.onResume();
 
-        mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
-            @Override
-            public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
-                updateTilesList();
-            }
-        };
+        mDevelopmentPreferencesListener = (sharedPreferences, key) -> updateTilesList();
         mDevelopmentPreferences.registerOnSharedPreferenceChangeListener(
                 mDevelopmentPreferencesListener);
 
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
index c81e1ee..2445619 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
@@ -20,6 +20,11 @@
 
 import android.bluetooth.BluetoothDevice;
 import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.VisibleForTesting;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
 
 import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
@@ -36,15 +41,42 @@
     public static final String KEY_DEVICE_ADDRESS = "device_address";
     private static final String TAG = "BTDeviceDetailsFrg";
 
+    @VisibleForTesting
+    static int EDIT_DEVICE_NAME_ITEM_ID = Menu.FIRST;
+
     private String mDeviceAddress;
+    private LocalBluetoothManager mManager;
+    private CachedBluetoothDevice mCachedDevice;
 
     public BluetoothDeviceDetailsFragment() {
         super(DISALLOW_CONFIG_BLUETOOTH);
     }
 
+    @VisibleForTesting
+    LocalBluetoothManager getLocalBluetoothManager(Context context) {
+        return Utils.getLocalBtManager(context);
+    }
+
+    @VisibleForTesting
+    CachedBluetoothDevice getCachedDevice(String deviceAddress) {
+        BluetoothDevice remoteDevice =
+                mManager.getBluetoothAdapter().getRemoteDevice(deviceAddress);
+        return mManager.getCachedDeviceManager().findDevice(remoteDevice);
+    }
+
+    public static BluetoothDeviceDetailsFragment newInstance(String deviceAddress) {
+        Bundle args = new Bundle(1);
+        args.putString(KEY_DEVICE_ADDRESS, deviceAddress);
+        BluetoothDeviceDetailsFragment fragment = new BluetoothDeviceDetailsFragment();
+        fragment.setArguments(args);
+        return fragment;
+    }
+
     @Override
     public void onAttach(Context context) {
         mDeviceAddress = getArguments().getString(KEY_DEVICE_ADDRESS);
+        mManager = getLocalBluetoothManager(context);
+        mCachedDevice = getCachedDevice(mDeviceAddress);
         super.onAttach(context);
     }
 
@@ -64,20 +96,36 @@
     }
 
     @Override
+    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+        MenuItem item = menu.add(0, EDIT_DEVICE_NAME_ITEM_ID, 0, R.string.bluetooth_rename_button);
+        item.setIcon(R.drawable.ic_mode_edit);
+        item.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+        super.onCreateOptionsMenu(menu, inflater);
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem menuItem) {
+        if (menuItem.getItemId() == EDIT_DEVICE_NAME_ITEM_ID) {
+            RemoteDeviceNameDialogFragment.newInstance(mCachedDevice).show(
+                    getFragmentManager(), RemoteDeviceNameDialogFragment.TAG);
+            return true;
+        }
+        return super.onOptionsItemSelected(menuItem);
+    }
+
+    @Override
     protected List<PreferenceController> getPreferenceControllers(Context context) {
         ArrayList<PreferenceController> controllers = new ArrayList<>();
-        LocalBluetoothManager manager = Utils.getLocalBtManager(context);
-        BluetoothDevice remoteDevice = manager.getBluetoothAdapter().getRemoteDevice(
-                mDeviceAddress);
-        CachedBluetoothDevice device = manager.getCachedDeviceManager().findDevice(remoteDevice);
-        if (device != null) {
+
+        if (mCachedDevice != null) {
             Lifecycle lifecycle = getLifecycle();
-            controllers.add(new BluetoothDetailsHeaderController(context, this, device, lifecycle));
-            controllers.add(new BluetoothDetailsButtonsController(context, this, device,
+            controllers.add(new BluetoothDetailsHeaderController(context, this, mCachedDevice,
                     lifecycle));
-            controllers.add(new BluetoothDetailsProfilesController(context, this, manager, device,
+            controllers.add(new BluetoothDetailsButtonsController(context, this, mCachedDevice,
                     lifecycle));
-            controllers.add(new BluetoothDetailsMacAddressController(context, this, device,
+            controllers.add(new BluetoothDetailsProfilesController(context, this, mManager,
+                    mCachedDevice, lifecycle));
+            controllers.add(new BluetoothDetailsMacAddressController(context, this, mCachedDevice,
                     lifecycle));
         }
         return controllers;
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceController.java b/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceController.java
index baab3fc..7e826c8 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceController.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceController.java
@@ -37,7 +37,6 @@
 import com.android.settingslib.bluetooth.LocalBluetoothManager;
 import com.android.settingslib.core.lifecycle.Lifecycle;
 import com.android.settingslib.core.lifecycle.LifecycleObserver;
-import com.android.settingslib.core.lifecycle.events.OnResume;
 import com.android.settingslib.core.lifecycle.events.OnStart;
 import com.android.settingslib.core.lifecycle.events.OnStop;
 
@@ -111,7 +110,8 @@
     @Override
     public boolean handlePreferenceTreeClick(Preference preference) {
         if (KEY_DEVICE_NAME.equals(preference.getKey())) {
-            new BluetoothNameDialogFragment().show(mFragment.getFragmentManager(), "rename device");
+            LocalDeviceNameDialogFragment.newInstance()
+                    .show(mFragment.getFragmentManager(), LocalDeviceNameDialogFragment.TAG);
             return true;
         }
 
diff --git a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
index 484d4b3..e415b47 100644
--- a/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothNameDialogFragment.java
@@ -18,19 +18,13 @@
 
 import android.app.AlertDialog;
 import android.app.Dialog;
-import android.app.DialogFragment;
-import android.bluetooth.BluetoothAdapter;
-import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.IntentFilter;
 import android.content.res.Configuration;
 import android.os.Bundle;
 import android.text.Editable;
 import android.text.InputFilter;
 import android.text.TextWatcher;
-import android.util.Log;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -40,25 +34,19 @@
 import android.widget.EditText;
 import android.widget.TextView;
 
-import com.android.internal.logging.nano.MetricsProto;
 import com.android.settings.R;
 import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
-import com.android.settingslib.bluetooth.LocalBluetoothAdapter;
-import com.android.settingslib.bluetooth.LocalBluetoothManager;
 
 /**
- * Dialog fragment for renaming the local Bluetooth device.
+ * Dialog fragment for renaming a Bluetooth device.
  */
-public final class BluetoothNameDialogFragment extends InstrumentedDialogFragment
+abstract class BluetoothNameDialogFragment extends InstrumentedDialogFragment
         implements TextWatcher {
     private static final int BLUETOOTH_NAME_MAX_LENGTH_BYTES = 248;
 
     private AlertDialog mAlertDialog;
     private Button mOkButton;
 
-    // accessed from inner class (not private to avoid thunks)
-    static final String TAG = "BluetoothNameDialogFragment";
-    LocalBluetoothAdapter mLocalAdapter;
     EditText mDeviceNameView;
 
     // This flag is set when the name is updated by code, to distinguish from user changes
@@ -71,63 +59,43 @@
     private static final String KEY_NAME = "device_name";
     private static final String KEY_NAME_EDITED = "device_name_edited";
 
-    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            String action = intent.getAction();
-            if (action.equals(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED)) {
-                updateDeviceName();
-            } else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED) &&
-                    (intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR) ==
-                            BluetoothAdapter.STATE_ON)) {
-                updateDeviceName();
-            }
-        }
-    };
+    /**
+     * @return the title to use for the dialog.
+     */
+    abstract protected int getDialogTitle();
 
-    @Override
-    public int getMetricsCategory() {
-        return MetricsProto.MetricsEvent.DIALOG_BLUETOOTH_RENAME;
-    }
+    /**
+     * @return the current name used for this device.
+     */
+    abstract protected String getDeviceName();
 
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
-        LocalBluetoothManager localManager = Utils.getLocalBtManager(getActivity());
-        mLocalAdapter = localManager.getBluetoothAdapter();
-    }
+    /**
+     * Set the device to the given name.
+     * @param deviceName the name to use
+     */
+    abstract protected void setDeviceName(String deviceName);
 
     @Override
     public Dialog onCreateDialog(Bundle savedInstanceState) {
-        String deviceName = mLocalAdapter.getName();
+        String deviceName = getDeviceName();
         if (savedInstanceState != null) {
             deviceName = savedInstanceState.getString(KEY_NAME, deviceName);
             mDeviceNameEdited = savedInstanceState.getBoolean(KEY_NAME_EDITED, false);
         }
-        mAlertDialog = new AlertDialog.Builder(getActivity())
-                .setTitle(R.string.bluetooth_rename_device)
+        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
+                .setTitle(getDialogTitle())
                 .setView(createDialogView(deviceName))
-                .setPositiveButton(R.string.bluetooth_rename_button,
-                        new DialogInterface.OnClickListener() {
-                            public void onClick(DialogInterface dialog, int which) {
-                                String deviceName = mDeviceNameView.getText().toString();
-                                setDeviceName(deviceName);
-                            }
-                        })
-                .setNegativeButton(android.R.string.cancel, null)
-                .create();
+                .setPositiveButton(R.string.bluetooth_rename_button, (dialog, which) -> {
+                    setDeviceName(mDeviceNameView.getText().toString());
+                })
+                .setNegativeButton(android.R.string.cancel, null);
+        mAlertDialog = builder.create();
         mAlertDialog.getWindow().setSoftInputMode(
                 WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
 
         return mAlertDialog;
     }
 
-    private void setDeviceName(String deviceName) {
-        Log.d(TAG, "Setting device name to " + deviceName);
-        mLocalAdapter.setName(deviceName);
-    }
-
     @Override
     public void onSaveInstanceState(Bundle outState) {
         outState.putString(KEY_NAME, mDeviceNameView.getText().toString());
@@ -174,23 +142,14 @@
             mOkButton = mAlertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
             mOkButton.setEnabled(mDeviceNameEdited);    // Ok button enabled after user edits
         }
-        IntentFilter filter = new IntentFilter();
-        filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
-        filter.addAction(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED);
-        getActivity().registerReceiver(mReceiver, filter);
-    }
-
-    @Override
-    public void onPause() {
-        super.onPause();
-        getActivity().unregisterReceiver(mReceiver);
     }
 
     void updateDeviceName() {
-        if (mLocalAdapter != null && mLocalAdapter.isEnabled()) {
+        String name = getDeviceName();
+        if (name != null) {
             mDeviceNameUpdated = true;
             mDeviceNameEdited = false;
-            mDeviceNameView.setText(mLocalAdapter.getName());
+            mDeviceNameView.setText(name);
         }
     }
 
diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java
index 4703031..85eb23e 100644
--- a/src/com/android/settings/bluetooth/BluetoothSettings.java
+++ b/src/com/android/settings/bluetooth/BluetoothSettings.java
@@ -316,7 +316,6 @@
             // New version - uses a separate screen.
             args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS,
                     device.getDevice().getAddress());
-            BluetoothDeviceDetailsFragment fragment = new BluetoothDeviceDetailsFragment();
             final SettingsActivity activity =
                     (SettingsActivity) BluetoothSettings.this.getActivity();
             activity.startPreferencePanel(this,
diff --git a/src/com/android/settings/bluetooth/LocalDeviceNameDialogFragment.java b/src/com/android/settings/bluetooth/LocalDeviceNameDialogFragment.java
new file mode 100644
index 0000000..029b974
--- /dev/null
+++ b/src/com/android/settings/bluetooth/LocalDeviceNameDialogFragment.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2017 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.bluetooth;
+
+import android.bluetooth.BluetoothAdapter;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+
+import com.android.internal.logging.nano.MetricsProto;
+import com.android.settings.R;
+import com.android.settingslib.bluetooth.LocalBluetoothAdapter;
+import com.android.settingslib.bluetooth.LocalBluetoothManager;
+
+/** Provides a dialog for changing the advertised name of the local bluetooth adapter. */
+public class LocalDeviceNameDialogFragment extends BluetoothNameDialogFragment {
+    public static final String TAG = "LocalAdapterName";
+    private LocalBluetoothAdapter mLocalAdapter;
+
+    public static LocalDeviceNameDialogFragment newInstance() {
+        return new LocalDeviceNameDialogFragment();
+    }
+
+    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String action = intent.getAction();
+            if (BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED.equals(action) ||
+                    (BluetoothAdapter.ACTION_STATE_CHANGED.equals(action) &&
+                            intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR)
+                                    == BluetoothAdapter.STATE_ON)) {
+                updateDeviceName();
+            }
+        }
+    };
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        LocalBluetoothManager localManager = Utils.getLocalBtManager(getActivity());
+        mLocalAdapter = localManager.getBluetoothAdapter();
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        IntentFilter filter = new IntentFilter();
+        filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
+        filter.addAction(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED);
+        getActivity().registerReceiver(mReceiver, filter);
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+        getActivity().unregisterReceiver(mReceiver);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return MetricsProto.MetricsEvent.DIALOG_BLUETOOTH_RENAME;
+    }
+
+    @Override
+    protected int getDialogTitle() {
+        return R.string.bluetooth_rename_device;
+    }
+
+    @Override
+    protected String getDeviceName() {
+        if (mLocalAdapter != null && mLocalAdapter.isEnabled()) {
+            return mLocalAdapter.getName();
+        }
+        return null;
+    }
+
+    @Override
+    protected void setDeviceName(String deviceName) {
+        mLocalAdapter.setName(deviceName);
+    }
+}
diff --git a/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragment.java b/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragment.java
new file mode 100644
index 0000000..4e5acefe
--- /dev/null
+++ b/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragment.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2017 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.bluetooth;
+
+import android.bluetooth.BluetoothDevice;
+import android.content.Context;
+import android.os.Bundle;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.logging.nano.MetricsProto;
+import com.android.settings.R;
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.LocalBluetoothManager;
+
+/** Provides a dialog for changing the display name of a remote bluetooth device. */
+public class RemoteDeviceNameDialogFragment extends BluetoothNameDialogFragment {
+    public static final String TAG = "RemoteDeviceName";
+    private static final String KEY_CACHED_DEVICE_ADDRESS = "cached_device";
+
+    private CachedBluetoothDevice mDevice;
+
+    public static RemoteDeviceNameDialogFragment newInstance(CachedBluetoothDevice device) {
+        Bundle args = new Bundle(1);
+        args.putString(KEY_CACHED_DEVICE_ADDRESS, device.getDevice().getAddress());
+        RemoteDeviceNameDialogFragment fragment = new RemoteDeviceNameDialogFragment();
+        fragment.setArguments(args);
+        return fragment;
+    }
+
+    @VisibleForTesting
+    CachedBluetoothDevice getDevice(Context context) {
+        String deviceAddress = getArguments().getString(KEY_CACHED_DEVICE_ADDRESS);
+        LocalBluetoothManager manager = Utils.getLocalBtManager(context);
+        BluetoothDevice device = manager.getBluetoothAdapter().getRemoteDevice(deviceAddress);
+        return manager.getCachedDeviceManager().findDevice(device);
+    }
+
+    @Override
+    public void onAttach(Context context) {
+        super.onAttach(context);
+        mDevice = getDevice(context);
+    }
+
+    @Override
+    public int getMetricsCategory() {
+        return MetricsProto.MetricsEvent.DIALOG_BLUETOOTH_PAIRED_DEVICE_RENAME;
+    }
+
+    @Override
+    protected int getDialogTitle() {
+        return R.string.bluetooth_device_name;
+    }
+
+    @Override
+    protected String getDeviceName() {
+        if (mDevice != null) {
+            return mDevice.getName();
+        }
+        return null;
+    }
+
+    @Override
+    protected void setDeviceName(String deviceName) {
+        if (mDevice != null) {
+            mDevice.setName(deviceName);
+        }
+    }
+}
diff --git a/src/com/android/settings/deviceinfo/SimStatus.java b/src/com/android/settings/deviceinfo/SimStatus.java
index 3be20bf..4bf73ea 100644
--- a/src/com/android/settings/deviceinfo/SimStatus.java
+++ b/src/com/android/settings/deviceinfo/SimStatus.java
@@ -16,6 +16,10 @@
 
 package com.android.settings.deviceinfo;
 
+import static android.content.Context.CARRIER_CONFIG_SERVICE;
+import static android.content.Context.TELEPHONY_SERVICE;
+
+import android.Manifest;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -58,9 +62,6 @@
 
 import java.util.List;
 
-import static android.content.Context.CARRIER_CONFIG_SERVICE;
-import static android.content.Context.TELEPHONY_SERVICE;
-
 
 /**
  * Display the following information
@@ -69,7 +70,7 @@
  * # Roaming
  * # Device Id (IMEI in GSM and MEID in CDMA)
  * # Network type
- * # Operator info (area info cell broadcast for Brazil)
+ * # Operator info (area update info cell broadcast)
  * # Signal Strength
  *
  */
@@ -87,18 +88,14 @@
     private static final String KEY_IMEI = "imei";
     private static final String KEY_IMEI_SV = "imei_sv";
     private static final String KEY_ICCID = "iccid";
-    private static final String COUNTRY_ABBREVIATION_BRAZIL = "br";
 
-    static final String CB_AREA_INFO_RECEIVED_ACTION =
-            "android.cellbroadcastreceiver.CB_AREA_INFO_RECEIVED";
+    static private final String CB_AREA_INFO_RECEIVED_ACTION =
+            "com.android.cellbroadcastreceiver.CB_AREA_INFO_RECEIVED";
 
-    static final String GET_LATEST_CB_AREA_INFO_ACTION =
-            "android.cellbroadcastreceiver.GET_LATEST_CB_AREA_INFO";
+    static private final String GET_LATEST_CB_AREA_INFO_ACTION =
+            "com.android.cellbroadcastreceiver.GET_LATEST_CB_AREA_INFO";
 
-    // Require the sender to have this permission to prevent third-party spoofing.
-    static final String CB_AREA_INFO_SENDER_PERMISSION =
-            "android.permission.RECEIVE_EMERGENCY_BROADCAST";
-
+    static private final String CELL_BROADCAST_RECEIVER_APP = "com.android.cellbroadcastreceiver";
 
     private TelephonyManager mTelephonyManager;
     private CarrierConfigManager mCarrierConfigManager;
@@ -118,7 +115,9 @@
     private List<SubscriptionInfo> mSelectableSubInfos;
 
     private PhoneStateListener mPhoneStateListener;
-    private BroadcastReceiver mAreaInfoReceiver = new BroadcastReceiver() {
+
+    // Once the cell broadcast configuration is moved into telephony framework,
+    private final BroadcastReceiver mAreaInfoReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
             String action = intent.getAction();
@@ -128,8 +127,7 @@
                     return;
                 }
                 CellBroadcastMessage cbMessage = (CellBroadcastMessage) extras.get("message");
-                if (cbMessage != null && cbMessage.getServiceCategory() == 50
-                        && mSir.getSubscriptionId() == cbMessage.getSubId()) {
+                if (cbMessage != null && mSir.getSubscriptionId() == cbMessage.getSubId()) {
                     String latestAreaInfo = cbMessage.getMessageBody();
                     updateAreaInfo(latestAreaInfo);
                 }
@@ -216,11 +214,12 @@
             if (mShowLatestAreaInfo) {
                 getContext().registerReceiver(mAreaInfoReceiver,
                         new IntentFilter(CB_AREA_INFO_RECEIVED_ACTION),
-                        CB_AREA_INFO_SENDER_PERMISSION, null);
+                        Manifest.permission.RECEIVE_EMERGENCY_BROADCAST, null);
                 // Ask CellBroadcastReceiver to broadcast the latest area info received
                 Intent getLatestIntent = new Intent(GET_LATEST_CB_AREA_INFO_ACTION);
+                getLatestIntent.setPackage(CELL_BROADCAST_RECEIVER_APP);
                 getContext().sendBroadcastAsUser(getLatestIntent, UserHandle.ALL,
-                        CB_AREA_INFO_SENDER_PERMISSION);
+                        Manifest.permission.RECEIVE_EMERGENCY_BROADCAST);
             }
         }
     }
@@ -382,11 +381,8 @@
 
     private void updatePreference() {
         if (mPhone.getPhoneType() != TelephonyManager.PHONE_TYPE_CDMA) {
-            // only show area info when SIM country is Brazil
-            if (COUNTRY_ABBREVIATION_BRAZIL.equals(mTelephonyManager.getSimCountryIso(
-                            mSir.getSubscriptionId()))) {
-                mShowLatestAreaInfo = true;
-            }
+            mShowLatestAreaInfo = Resources.getSystem().getBoolean(
+                    com.android.internal.R.bool.config_showAreaUpdateInfoSettings);
         }
         PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(
                 mSir.getSubscriptionId());
diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java
index e34a90b..1902a52 100644
--- a/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java
+++ b/src/com/android/settings/fingerprint/FingerprintEnrollFindSensor.java
@@ -22,6 +22,7 @@
 import android.os.UserHandle;
 import android.support.annotation.Nullable;
 import android.view.View;
+import android.widget.Button;
 
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.settings.R;
@@ -48,6 +49,9 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(getContentView());
+        Button skipButton = findViewById(R.id.skip_button);
+        skipButton.setOnClickListener(this);
+
         setHeaderText(R.string.security_settings_fingerprint_enroll_find_sensor_title);
         if (savedInstanceState != null) {
             mLaunchedConfirmLock = savedInstanceState.getBoolean(EXTRA_KEY_LAUNCHED_CONFIRM);
@@ -132,9 +136,15 @@
     }
 
     @Override
-    protected void onNextButtonClick() {
-        mNextClicked = true;
-        proceedToEnrolling(true /* cancelEnrollment */);
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.skip_button:
+                setResult(RESULT_SKIP);
+                finish();
+                break;
+            default:
+                super.onClick(v);
+        }
     }
 
     private void proceedToEnrolling(boolean cancelEnrollment) {
diff --git a/src/com/android/settings/fuelgauge/BatteryInfo.java b/src/com/android/settings/fuelgauge/BatteryInfo.java
index e9863b3..5eada88 100644
--- a/src/com/android/settings/fuelgauge/BatteryInfo.java
+++ b/src/com/android/settings/fuelgauge/BatteryInfo.java
@@ -227,8 +227,9 @@
                 final String chargeStatusLabel = resources.getString(
                         R.string.battery_info_status_charging_lower);
                 info.remainingLabel = null;
-                info.chargeLabel = resources.getString(
-                        R.string.power_charging, info.batteryPercentString, chargeStatusLabel);
+                info.chargeLabel = info.batteryLevel == 100 ? info.batteryPercentString :
+                        resources.getString(R.string.power_charging, info.batteryPercentString,
+                                chargeStatusLabel);
             }
         }
         return info;
diff --git a/src/com/android/settings/fuelgauge/BatteryUtils.java b/src/com/android/settings/fuelgauge/BatteryUtils.java
index 64039ef..4abc1b1 100644
--- a/src/com/android/settings/fuelgauge/BatteryUtils.java
+++ b/src/com/android/settings/fuelgauge/BatteryUtils.java
@@ -45,6 +45,7 @@
  */
 public class BatteryUtils {
     public static final int UID_NULL = -1;
+
     @Retention(RetentionPolicy.SOURCE)
     @IntDef({StatusType.FOREGROUND,
             StatusType.BACKGROUND,
@@ -171,7 +172,9 @@
         for (int i = 0, size = sippers.size(); i < size; i++) {
             final BatteryStats.Uid uid = sippers.get(i).uidObj;
             if (uid != null) {
-                final long timeMs = getForegroundActivityTotalTimeMs(uid, rawRealtimeMs);
+                final long timeMs = Math.min(getForegroundActivityTotalTimeMs(uid, rawRealtimeMs),
+                        getProcessTimeMs(StatusType.FOREGROUND, uid,
+                                BatteryStats.STATS_SINCE_CHARGED));
                 activityTimeArray.put(uid.getUid(), timeMs);
                 totalActivityTimeMs += timeMs;
             }
@@ -248,7 +251,6 @@
      * @return the package name. If there are multiple packages related to
      * given id, return the first one. Or return null if there are no known
      * packages with the given id
-     *
      * @see PackageManager#getPackagesForUid(int)
      */
     public String getPackageName(int uid) {
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
index 732db23..969afb9 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
@@ -63,11 +63,6 @@
     boolean isPowerAccountingToggleEnabled();
 
     /**
-     * Check whether the anomaly detection is enabled
-     */
-    boolean isAnomalyDetectionEnabled();
-
-    /**
      * Returns an improved prediction for battery time remaining.
      */
     long getEnhancedBatteryPrediction(Context context);
@@ -88,12 +83,6 @@
     long getTimeRemainingEstimate(Cursor cursor);
 
     /**
-     * Check whether a specific anomaly detector is enabled
-     */
-    //TODO(b/62096650): remove this method and use AnomalyDetectionPolicy instead
-    boolean isAnomalyDetectorEnabled(@Anomaly.AnomalyType int type);
-
-    /**
      * Checks whether debugging should be enabled for battery estimates.
      * @return
      */
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
index 1d8e03a..df7e7e1 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
@@ -89,11 +89,6 @@
     }
 
     @Override
-    public boolean isAnomalyDetectionEnabled() {
-        return false;
-    }
-
-    @Override
     public long getEnhancedBatteryPrediction(Context context) {
         return -1;
     }
@@ -114,11 +109,6 @@
     }
 
     @Override
-    public boolean isAnomalyDetectorEnabled(@Anomaly.AnomalyType int type) {
-        return false;
-    }
-
-    @Override
     public String getEnhancedEstimateDebugString(String timeRemaining) {
         return null;
     }
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 26dac41..730f061 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -46,6 +46,7 @@
 import android.view.View.OnClickListener;
 import android.view.View.OnLongClickListener;
 import android.widget.TextView;
+
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.internal.os.BatterySipper;
 import com.android.internal.os.BatterySipper.DrainType;
@@ -63,11 +64,13 @@
 import com.android.settings.display.BatteryPercentagePreferenceController;
 import com.android.settings.display.TimeoutPreferenceController;
 import com.android.settings.fuelgauge.anomaly.Anomaly;
+import com.android.settings.fuelgauge.anomaly.AnomalyDetectionPolicy;
 import com.android.settings.fuelgauge.anomaly.AnomalyDialogFragment.AnomalyDialogListener;
 import com.android.settings.fuelgauge.anomaly.AnomalyLoader;
 import com.android.settings.fuelgauge.anomaly.AnomalySummaryPreferenceController;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.search.BaseSearchIndexProvider;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -573,31 +576,8 @@
                 if (((int) (percentOfTotal + .5)) < 1) {
                     continue;
                 }
-                if (sipper.drainType == BatterySipper.DrainType.OVERCOUNTED) {
-                    // Don't show over-counted unless it is at least 2/3 the size of
-                    // the largest real entry, and its percent of total is more significant
-                    if (sipper.totalPowerMah < ((mStatsHelper.getMaxRealPower() * 2) / 3)) {
-                        continue;
-                    }
-                    if (percentOfTotal < 10) {
-                        continue;
-                    }
-                    if ("user".equals(Build.TYPE)) {
-                        continue;
-                    }
-                }
-                if (sipper.drainType == BatterySipper.DrainType.UNACCOUNTED) {
-                    // Don't show over-counted unless it is at least 1/2 the size of
-                    // the largest real entry, and its percent of total is more significant
-                    if (sipper.totalPowerMah < (mStatsHelper.getMaxRealPower() / 2)) {
-                        continue;
-                    }
-                    if (percentOfTotal < 5) {
-                        continue;
-                    }
-                    if ("user".equals(Build.TYPE)) {
-                        continue;
-                    }
+                if (shouldHideSipper(sipper)) {
+                    continue;
                 }
                 final UserHandle userHandle = new UserHandle(UserHandle.getUserId(sipper.getUid()));
                 final BatteryEntry entry = new BatteryEntry(getActivity(), mHandler, mUm, sipper);
@@ -648,6 +628,13 @@
     }
 
     @VisibleForTesting
+    boolean shouldHideSipper(BatterySipper sipper) {
+        // Don't show over-counted and unaccounted in any condition
+        return sipper.drainType == BatterySipper.DrainType.OVERCOUNTED
+                || sipper.drainType == BatterySipper.DrainType.UNACCOUNTED;
+    }
+
+    @VisibleForTesting
     void refreshAnomalyIcon() {
         for (int i = 0, size = mAnomalySparseArray.size(); i < size; i++) {
             final String key = extractKeyFromUid(mAnomalySparseArray.keyAt(i));
@@ -661,12 +648,17 @@
 
     @VisibleForTesting
     void initAnomalyDetectionIfPossible() {
-        if (mPowerFeatureProvider.isAnomalyDetectionEnabled()) {
+        if (getAnomalyDetectionPolicy().isAnomalyDetectionEnabled()) {
             getLoaderManager().initLoader(ANOMALY_LOADER, Bundle.EMPTY, mAnomalyLoaderCallbacks);
         }
     }
 
     @VisibleForTesting
+    AnomalyDetectionPolicy getAnomalyDetectionPolicy() {
+        return new AnomalyDetectionPolicy(getContext());
+    }
+
+    @VisibleForTesting
     BatterySipper findBatterySipperByType(List<BatterySipper> usageList, DrainType type) {
         for (int i = 0, size = usageList.size(); i < size; i++) {
             final BatterySipper sipper = usageList.get(i);
diff --git a/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicy.java b/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicy.java
index 647737c..4829ca0 100644
--- a/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicy.java
+++ b/src/com/android/settings/fuelgauge/anomaly/AnomalyDetectionPolicy.java
@@ -51,7 +51,7 @@
      * @see Settings.Global#ANOMALY_DETECTION_CONSTANTS
      * @see #KEY_ANOMALY_DETECTION_ENABLED
      */
-    public final boolean anomalyDetectionEnabled;
+    final boolean anomalyDetectionEnabled;
 
     /**
      * {@code true} if wakelock anomaly detection is enabled
@@ -59,7 +59,7 @@
      * @see Settings.Global#ANOMALY_DETECTION_CONSTANTS
      * @see #KEY_WAKELOCK_DETECTION_ENABLED
      */
-    public final boolean wakeLockDetectionEnabled;
+    final boolean wakeLockDetectionEnabled;
 
     /**
      * {@code true} if wakeup alarm detection is enabled
@@ -67,7 +67,7 @@
      * @see Settings.Global#ANOMALY_DETECTION_CONSTANTS
      * @see #KEY_WAKEUP_ALARM_DETECTION_ENABLED
      */
-    public final boolean wakeupAlarmDetectionEnabled;
+    final boolean wakeupAlarmDetectionEnabled;
 
     /**
      * {@code true} if bluetooth scanning detection is enabled
@@ -75,7 +75,7 @@
      * @see Settings.Global#ANOMALY_DETECTION_CONSTANTS
      * @see #KEY_BLUETOOTH_SCAN_THRESHOLD
      */
-    public final boolean bluetoothScanDetectionEnabled;
+    final boolean bluetoothScanDetectionEnabled;
 
     /**
      * Threshold for wakelock time in milli seconds
@@ -132,6 +132,10 @@
                 30 * DateUtils.MINUTE_IN_MILLIS);
     }
 
+    public boolean isAnomalyDetectionEnabled() {
+        return anomalyDetectionEnabled;
+    }
+
     public boolean isAnomalyDetectorEnabled(@Anomaly.AnomalyType int type) {
         switch (type) {
             case Anomaly.AnomalyType.WAKE_LOCK:
diff --git a/src/com/android/settings/gestures/AssistGestureFeatureProvider.java b/src/com/android/settings/gestures/AssistGestureFeatureProvider.java
index 8902393..447562d 100644
--- a/src/com/android/settings/gestures/AssistGestureFeatureProvider.java
+++ b/src/com/android/settings/gestures/AssistGestureFeatureProvider.java
@@ -32,9 +32,6 @@
     /** Returns true if the sensor is available. */
     boolean isSensorAvailable(Context context);
 
-    /** Returns the resource */
-    int getPreferenceResourceId();
-
     /** Returns a list of additional preference controllers */
     List<PreferenceController> getControllers(Context context, Lifecycle lifecycle);
 
diff --git a/src/com/android/settings/gestures/AssistGestureFeatureProviderImpl.java b/src/com/android/settings/gestures/AssistGestureFeatureProviderImpl.java
index a2579ac..4509862 100644
--- a/src/com/android/settings/gestures/AssistGestureFeatureProviderImpl.java
+++ b/src/com/android/settings/gestures/AssistGestureFeatureProviderImpl.java
@@ -38,11 +38,6 @@
     }
 
     @Override
-    public int getPreferenceResourceId() {
-        return R.xml.assist_gesture_settings;
-    }
-
-    @Override
     public List<PreferenceController> getControllers(Context context, Lifecycle lifecycle) {
         return new ArrayList<>();
     }
diff --git a/src/com/android/settings/gestures/AssistGestureSettings.java b/src/com/android/settings/gestures/AssistGestureSettings.java
index 93d3a39..44b173a 100644
--- a/src/com/android/settings/gestures/AssistGestureSettings.java
+++ b/src/com/android/settings/gestures/AssistGestureSettings.java
@@ -49,8 +49,7 @@
 
     @Override
     protected int getPreferenceScreenResId() {
-        return FeatureFactory.getFactory(getContext())
-                .getAssistGestureFeatureProvider().getPreferenceResourceId();
+        return R.xml.assist_gesture_settings;
     }
 
     @Override
diff --git a/src/com/android/settings/password/ChooseLockPassword.java b/src/com/android/settings/password/ChooseLockPassword.java
index b41a40f..b6f2387 100644
--- a/src/com/android/settings/password/ChooseLockPassword.java
+++ b/src/com/android/settings/password/ChooseLockPassword.java
@@ -339,6 +339,16 @@
             mNextButton = (Button) view.findViewById(R.id.next_button);
             mNextButton.setOnClickListener(this);
 
+            if (mForFingerprint) {
+                TextView fingerprintBackupMessage =
+                        view.findViewById(R.id.fingerprint_backup_message);
+                if (fingerprintBackupMessage != null) {
+                    fingerprintBackupMessage.setVisibility(View.VISIBLE);
+                    fingerprintBackupMessage
+                            .setText(R.string.setup_lock_settings_picker_fingerprint_message);
+                }
+            }
+
             mIsAlphaMode = DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC == mRequestedQuality
                     || DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC == mRequestedQuality
                     || DevicePolicyManager.PASSWORD_QUALITY_COMPLEX == mRequestedQuality;
diff --git a/src/com/android/settings/search/SearchFeatureProvider.java b/src/com/android/settings/search/SearchFeatureProvider.java
index 50edae7..8b589cd 100644
--- a/src/com/android/settings/search/SearchFeatureProvider.java
+++ b/src/com/android/settings/search/SearchFeatureProvider.java
@@ -37,14 +37,6 @@
     boolean isEnabled(Context context);
 
     /**
-     * Inserts the Menu items into Settings activity.
-     *
-     * @param menu Items will be inserted into this menu.
-     * @param activity The activity that precedes SearchActivity.
-     */
-    void setUpSearchMenu(Menu menu, Activity activity);
-
-    /**
      * Returns a new loader to search in index database.
      */
     DatabaseResultLoader getDatabaseSearchLoader(Context context, String query);
diff --git a/src/com/android/settings/search/SearchFeatureProviderImpl.java b/src/com/android/settings/search/SearchFeatureProviderImpl.java
index 8bb57c6..99771db 100644
--- a/src/com/android/settings/search/SearchFeatureProviderImpl.java
+++ b/src/com/android/settings/search/SearchFeatureProviderImpl.java
@@ -44,23 +44,6 @@
     }
 
     @Override
-    public void setUpSearchMenu(Menu menu, final Activity activity) {
-        if (menu == null || activity == null) {
-            return;
-        }
-        String menuTitle = activity.getString(R.string.search_menu);
-        MenuItem menuItem = menu.add(Menu.NONE, Menu.NONE, Menu.NONE, menuTitle)
-                .setIcon(R.drawable.ic_search_24dp)
-                .setOnMenuItemClickListener(item -> {
-                    Intent intent = new Intent(activity, SearchActivity.class);
-                    activity.startActivity(intent);
-                    return true;
-                });
-
-        menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
-    }
-
-    @Override
     public DatabaseResultLoader getDatabaseSearchLoader(Context context, String query) {
         return new DatabaseResultLoader(context, query, getSiteMapManager());
     }
diff --git a/src/com/android/settings/wifi/ConfigureWifiSettings.java b/src/com/android/settings/wifi/ConfigureWifiSettings.java
index 84c299e..a50a1d9 100644
--- a/src/com/android/settings/wifi/ConfigureWifiSettings.java
+++ b/src/com/android/settings/wifi/ConfigureWifiSettings.java
@@ -61,7 +61,6 @@
         super.onAttach(context);
         mProgressiveDisclosureMixin.setTileLimit(
             mUseOpenWifiPreferenceController.isAvailable() ? 3 : 2);
-        ((SettingsActivity) getActivity()).setDisplaySearchMenu(true);
     }
 
     @Override
diff --git a/tests/robotests/res/layout-mcc999/fingerprint_enroll_find_sensor.xml b/tests/robotests/res/layout-mcc999/fingerprint_enroll_find_sensor.xml
index 04489de..cedf5b9 100644
--- a/tests/robotests/res/layout-mcc999/fingerprint_enroll_find_sensor.xml
+++ b/tests/robotests/res/layout-mcc999/fingerprint_enroll_find_sensor.xml
@@ -17,10 +17,12 @@
 
 <com.android.setupwizardlib.GlifLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/setup_wizard_layout"
     style="?attr/fingerprint_layout_theme"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    app:suwFooter="@layout/fingerprint_enroll_find_sensor_base_footer">
 
     <FrameLayout
         android:layout_width="match_parent"
@@ -65,7 +67,7 @@
                 android:layout_weight="1"/>
 
             <Button
-                style="@style/SuwGlifButton.Primary"
+                style="@style/SuwGlifButton.Secondary"
                 android:id="@+id/next_button"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
diff --git a/tests/robotests/src/com/android/settings/SettingsActivityTest.java b/tests/robotests/src/com/android/settings/SettingsActivityTest.java
index 28babc2..3fc46e8 100644
--- a/tests/robotests/src/com/android/settings/SettingsActivityTest.java
+++ b/tests/robotests/src/com/android/settings/SettingsActivityTest.java
@@ -67,15 +67,10 @@
     private Bitmap mBitmap;
     private SettingsActivity mActivity;
 
-    private FakeFeatureFactory mFeatureFactory;
-
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
 
-        FakeFeatureFactory.setupForTest(mContext);
-        mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
-
         mActivity = spy(new SettingsActivity());
         doReturn(mBitmap).when(mActivity).getBitmapFromXmlResource(anyInt());
     }
@@ -99,26 +94,6 @@
     }
 
     @Test
-    public void testCreateOptionsMenu_setsUpSearch() {
-        ReflectionHelpers.setField(mActivity, "mSearchFeatureProvider",
-                mFeatureFactory.getSearchFeatureProvider());
-        mActivity.mDisplaySearch = true;
-        mActivity.onCreateOptionsMenu(null);
-
-        verify(mFeatureFactory.getSearchFeatureProvider()).setUpSearchMenu(nullable(Menu.class),
-                nullable(Activity.class));
-    }
-
-    @Test
-    public void testSaveState_DisplaySearchSaved() {
-        mActivity.mDisplaySearch = true;
-        Bundle bundle = new Bundle();
-        mActivity.saveState(bundle);
-
-        assertThat((boolean) bundle.get(SettingsActivity.SAVE_KEY_SHOW_SEARCH)).isTrue();
-    }
-
-    @Test
     public void testSaveState_EnabledHomeSaved() {
         mActivity.mDisplayHomeAsUpEnabled = true;
         Bundle bundle = new Bundle();
@@ -128,24 +103,6 @@
     }
 
     @Test
-    public void testRestoreState_DisplaySearchRestored() {
-        Bundle bundle = new Bundle();
-        bundle.putBoolean(SettingsActivity.SAVE_KEY_SHOW_SEARCH, true);
-        mActivity.onRestoreInstanceState(bundle);
-
-        assertThat(mActivity.mDisplaySearch).isTrue();
-    }
-
-    @Test
-    public void testRestoreState_EnabledHomeRestored() {
-        Bundle bundle = new Bundle();
-        bundle.putBoolean(SettingsActivity.SAVE_KEY_SHOW_SEARCH, true);
-        mActivity.onRestoreInstanceState(bundle);
-
-        assertThat(mActivity.mDisplaySearch).isTrue();
-    }
-
-    @Test
     public void testOnClick() {
         doReturn("com.android.settings").when(mActivity).getPackageName();
 
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java
new file mode 100644
index 0000000..7bd1203
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragmentTest.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2017 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.bluetooth;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.app.Fragment;
+import android.app.FragmentManager;
+import android.app.FragmentTransaction;
+import android.content.Context;
+import android.os.Bundle;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+
+import com.android.settings.R;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.LocalBluetoothManager;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+import org.robolectric.fakes.RoboMenu;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class BluetoothDeviceDetailsFragmentTest {
+    private BluetoothDeviceDetailsFragment mFragment;
+    private Context mContext;
+
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private CachedBluetoothDevice mCachedDevice;
+
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private LocalBluetoothManager mLocalManager;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(RuntimeEnvironment.application);
+        FakeFeatureFactory.setupForTest(mContext);
+
+        String deviceAddress = "55:66:77:88:99:AA";
+        mFragment = spy(BluetoothDeviceDetailsFragment.newInstance(deviceAddress));
+        doReturn(mLocalManager).when(mFragment).getLocalBluetoothManager(any());
+        doReturn(mCachedDevice).when(mFragment).getCachedDevice(any());
+
+        when(mCachedDevice.getDevice().getAddress()).thenReturn(deviceAddress);
+        Bundle args = new Bundle();
+        args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, deviceAddress);
+        mFragment.setArguments(args);
+        mFragment.onAttach(mContext);
+    }
+
+    @Test
+    public void renameControlGetsAdded() {
+        RoboMenu menu = new RoboMenu(mContext);
+        MenuInflater inflater = new MenuInflater(mContext);
+        mFragment.onCreateOptionsMenu(menu, inflater);
+        MenuItem item = menu.getItem(0);
+        assertThat(item.getTitle()).isEqualTo(mContext.getString(R.string.bluetooth_rename_button));
+        assertThat(item.getIcon()).isEqualTo(mContext.getDrawable(R.drawable.ic_mode_edit));
+    }
+
+    @Test
+    public void renameControlClicked() {
+        RoboMenu menu = new RoboMenu(mContext);
+        MenuInflater inflater = new MenuInflater(mContext);
+        mFragment.onCreateOptionsMenu(menu, inflater);
+        MenuItem item = menu.getItem(0);
+        assertThat(item.getItemId()).isEqualTo(
+                BluetoothDeviceDetailsFragment.EDIT_DEVICE_NAME_ITEM_ID);
+
+        FragmentManager fragmentManager = mock(FragmentManager.class);
+        when(mFragment.getFragmentManager()).thenReturn(fragmentManager);
+        FragmentTransaction ft = mock(FragmentTransaction.class);
+        when(fragmentManager.beginTransaction()).thenReturn(ft);
+
+        ArgumentCaptor<Fragment> captor = ArgumentCaptor.forClass(Fragment.class);
+        mFragment.onOptionsItemSelected(item);
+        verify(ft).add(captor.capture(), eq(RemoteDeviceNameDialogFragment.TAG));
+        RemoteDeviceNameDialogFragment dialog = (RemoteDeviceNameDialogFragment) captor.getValue();
+        assertThat(dialog).isNotNull();
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java b/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java
new file mode 100644
index 0000000..2d7f215
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragmentTest.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2017 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.bluetooth;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.widget.Button;
+import android.widget.EditText;
+
+import com.android.settings.R;
+import com.android.settings.TestConfig;
+import com.android.settings.testutils.FakeFeatureFactory;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowDialog;
+import org.robolectric.util.FragmentTestUtil;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class RemoteDeviceNameDialogFragmentTest {
+
+    @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+    private CachedBluetoothDevice mCachedDevice;
+
+    private RemoteDeviceNameDialogFragment mFragment;
+    private Context mContext;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext = spy(RuntimeEnvironment.application);
+        FakeFeatureFactory.setupForTest(mContext);
+
+        String deviceAddress = "55:66:77:88:99:AA";
+        when(mCachedDevice.getDevice().getAddress()).thenReturn(deviceAddress);
+        mFragment = spy(RemoteDeviceNameDialogFragment.newInstance(mCachedDevice));
+        doReturn(mCachedDevice).when(mFragment).getDevice(any());
+    }
+
+    /**
+     * Helper method to set the mock device's name and show the dialog.
+     *
+     * @param deviceName what name to set
+     * @return the dialog created
+     */
+    AlertDialog startDialog(String deviceName) {
+        when(mCachedDevice.getName()).thenReturn(deviceName);
+        FragmentTestUtil.startFragment(mFragment);
+        return (AlertDialog) ShadowDialog.getLatestDialog();
+    }
+
+    @Test
+    public void deviceNameDisplayIsCorrect() {
+        String deviceName = "ABC Corp Headphones";
+        AlertDialog dialog = startDialog(deviceName);
+        EditText editText = (EditText) dialog.findViewById(R.id.edittext);
+        assertThat(editText.getText().toString()).isEqualTo(deviceName);
+
+        // Make sure that the "rename" button isn't enabled since the text hasn't changed yet, but
+        // the "cancel" button should be enabled.
+        Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
+        assertThat(positiveButton.isEnabled()).isFalse();
+        Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
+        assertThat(negativeButton.isEnabled()).isTrue();
+    }
+
+    @Test
+    public void deviceNameEditSucceeds() {
+        String deviceNameInitial = "ABC Corp Headphones";
+        String deviceNameModified = "My Headphones";
+        AlertDialog dialog = startDialog(deviceNameInitial);
+
+        // Before modifying the text the "rename" button should be disabled but the cancel button
+        // should be enabled.
+        Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
+        Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
+        assertThat(negativeButton.isEnabled()).isTrue();
+        assertThat(positiveButton.isEnabled()).isFalse();
+
+        // Once we modify the text, the positive button should be clickable, and clicking it should
+        // cause a call to change the name.
+        EditText editText = (EditText) dialog.findViewById(R.id.edittext);
+        editText.setText(deviceNameModified);
+        assertThat(positiveButton.isEnabled()).isTrue();
+        positiveButton.performClick();
+        verify(mCachedDevice).setName(deviceNameModified);
+    }
+
+    @Test
+    public void deviceNameEditThenCancelDoesntRename() {
+        String deviceNameInitial = "ABC Corp Headphones";
+        String deviceNameModified = "My Headphones";
+        AlertDialog dialog = startDialog(deviceNameInitial);
+
+        // Modifying the text but then hitting cancel should not cause the name to change.
+        Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
+        assertThat(negativeButton.isEnabled()).isTrue();
+        EditText editText = (EditText) dialog.findViewById(R.id.edittext);
+        editText.setText(deviceNameModified);
+        negativeButton.performClick();
+        verify(mCachedDevice, never()).setName(anyString());
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java
index 84dfbfd..344914a 100644
--- a/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java
+++ b/tests/robotests/src/com/android/settings/fingerprint/FingerprintEnrollFindSensorTest.java
@@ -25,15 +25,16 @@
 
 import android.content.ComponentName;
 import android.content.Intent;
+import android.hardware.fingerprint.FingerprintManager;
 import android.hardware.fingerprint.FingerprintManager.EnrollmentCallback;
 import android.os.CancellationSignal;
 import android.widget.Button;
 
 import com.android.settings.R;
-import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.password.ChooseLockSettingsHelper;
 import com.android.settings.password.IFingerprintManager;
+import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.testutils.shadow.SettingsShadowResources;
 import com.android.settings.testutils.shadow.ShadowDynamicIndexableContentMonitor;
 import com.android.settings.testutils.shadow.ShadowEventLogWriter;
@@ -92,13 +93,26 @@
     }
 
     @Test
-    public void clickNextAndFingerprint_shouldNotCrash() {
+    public void enrollFingerprint_shouldProceed() {
         EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
 
-        Button nextButton = mActivity.findViewById(R.id.next_button);
-        nextButton.performClick();
         enrollmentCallback.onEnrollmentProgress(123);
-        nextButton.performClick();
+        enrollmentCallback.onEnrollmentError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, "test");
+
+        ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
+        IntentForResult startedActivity =
+                shadowActivity.getNextStartedActivityForResult();
+        assertThat(startedActivity).named("Next activity 1").isNotNull();
+        assertThat(startedActivity.intent.getComponent())
+                .isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
+    }
+
+    @Test
+    public void enrollFingerprintTwice_shouldStartOneEnrolling() {
+        EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
+
+        enrollmentCallback.onEnrollmentProgress(123);
+        enrollmentCallback.onEnrollmentProgress(123);  // A second enroll should be a no-op
 
         ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
         IntentForResult startedActivity =
@@ -120,9 +134,7 @@
     public void layoutWithoutAnimation_shouldNotCrash() {
         EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
         enrollmentCallback.onEnrollmentProgress(123);
-
-        Button nextButton = mActivity.findViewById(R.id.next_button);
-        nextButton.performClick();
+        enrollmentCallback.onEnrollmentError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, "test");
 
         ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
         IntentForResult startedActivity =
@@ -132,6 +144,16 @@
                 .isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
     }
 
+    @Test
+    public void clickSkip_shouldReturnResultSkip() {
+        Button skipButton = mActivity.findViewById(R.id.skip_button);
+        skipButton.performClick();
+
+        ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
+        assertThat(shadowActivity.getResultCode()).named("result code")
+                .isEqualTo(FingerprintEnrollBase.RESULT_SKIP);
+    }
+
     private EnrollmentCallback verifyAndCaptureEnrollmentCallback() {
         ArgumentCaptor<EnrollmentCallback> callbackCaptor =
                 ArgumentCaptor.forClass(EnrollmentCallback.class);
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java
index cf1146e..715e4f0 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryInfoTest.java
@@ -164,4 +164,15 @@
         assertThat(info.remainingLabel.toString())
                 .isEqualTo(TEST_CHARGE_TIME_REMAINING_STRINGIFIED);
     }
+
+    @Test
+    public void testGetBatteryInfo_pluggedInWithFullBattery_onlyShowBatteryLevel() {
+        mChargingBatteryBroadcast.putExtra(BatteryManager.EXTRA_LEVEL, 100);
+
+        BatteryInfo info = BatteryInfo.getBatteryInfo(mContext, mChargingBatteryBroadcast,
+                mBatteryStats, SystemClock.elapsedRealtime() * 1000, false /* shortString */,
+                1000, false /* basedOnUsage */);
+
+        assertThat(info.chargeLabel).isEqualTo("100%");
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
index d23301d..8dbb3be 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
@@ -69,8 +69,8 @@
     private static final long TIME_STATE_TOP_SLEEPING = 2500 * UNIT;
     private static final long TIME_STATE_FOREGROUND = 3000 * UNIT;
     private static final long TIME_STATE_BACKGROUND = 6000 * UNIT;
-    private static final long TIME_FOREGROUND_ACTIVITY_ZERO = 0;
-    private static final long TIME_FOREGROUND_ACTIVITY = 100 * DateUtils.MINUTE_IN_MILLIS;
+    private static final long TIME_FOREGROUND_ZERO = 0;
+    private static final long TIME_FOREGROUND = 100 * DateUtils.MINUTE_IN_MILLIS;
     private static final long TIME_SINCE_LAST_FULL_CHARGE_MS = 120 * 60 * 1000;
     private static final long TIME_SINCE_LAST_FULL_CHARGE_US =
             TIME_SINCE_LAST_FULL_CHARGE_MS * 1000;
@@ -294,24 +294,29 @@
 
     @Test
     public void testSmearScreenBatterySipper() {
-        final BatterySipper sipperNull = createTestSmearBatterySipper(TIME_FOREGROUND_ACTIVITY_ZERO,
-                BATTERY_APP_USAGE, 0 /* uid */, true /* isUidNull */);
-        final BatterySipper sipperBg = createTestSmearBatterySipper(TIME_FOREGROUND_ACTIVITY_ZERO,
-                BATTERY_APP_USAGE, 1 /* uid */, false /* isUidNull */);
-        final BatterySipper sipperFg = createTestSmearBatterySipper(TIME_FOREGROUND_ACTIVITY,
-                BATTERY_APP_USAGE, 2 /* uid */, false /* isUidNull */);
+        final BatterySipper sipperNull = createTestSmearBatterySipper(TIME_FOREGROUND_ZERO,
+                TIME_FOREGROUND_ZERO + 500, BATTERY_APP_USAGE, 0 /* uid */, true /* isUidNull */);
+        final BatterySipper sipperBg = createTestSmearBatterySipper(TIME_FOREGROUND_ZERO + 100,
+                TIME_FOREGROUND_ZERO, BATTERY_APP_USAGE, 1 /* uid */, false /* isUidNull */);
+        final BatterySipper sipperFg = createTestSmearBatterySipper(TIME_FOREGROUND,
+                TIME_FOREGROUND + 200, BATTERY_APP_USAGE, 2 /* uid */, false /* isUidNull */);
+        final BatterySipper sipperFg2 = createTestSmearBatterySipper(TIME_FOREGROUND + 600,
+                TIME_FOREGROUND, BATTERY_APP_USAGE, 3 /* uid */, false /* isUidNull */);
 
         final List<BatterySipper> sippers = new ArrayList<>();
         sippers.add(sipperNull);
         sippers.add(sipperBg);
         sippers.add(sipperFg);
+        sippers.add(sipperFg2);
 
         mBatteryUtils.smearScreenBatterySipper(sippers, mScreenBatterySipper);
 
         assertThat(sipperNull.totalPowerMah).isWithin(PRECISION).of(BATTERY_APP_USAGE);
         assertThat(sipperBg.totalPowerMah).isWithin(PRECISION).of(BATTERY_APP_USAGE);
         assertThat(sipperFg.totalPowerMah).isWithin(PRECISION).of(
-                BATTERY_APP_USAGE + BATTERY_SCREEN_USAGE);
+                BATTERY_APP_USAGE + BATTERY_SCREEN_USAGE / 2);
+        assertThat(sipperFg2.totalPowerMah).isWithin(PRECISION).of(
+                BATTERY_APP_USAGE + BATTERY_SCREEN_USAGE / 2);
     }
 
     @Test
@@ -353,8 +358,8 @@
                 .isEqualTo(R.string.battery_abnormal_location_summary);
     }
 
-    private BatterySipper createTestSmearBatterySipper(long activityTime, double totalPowerMah,
-            int uidCode, boolean isUidNull) {
+    private BatterySipper createTestSmearBatterySipper(long activityTime, long topTime,
+            double totalPowerMah, int uidCode, boolean isUidNull) {
         final BatterySipper sipper = mock(BatterySipper.class);
         sipper.drainType = BatterySipper.DrainType.APP;
         sipper.totalPowerMah = totalPowerMah;
@@ -363,6 +368,8 @@
             final BatteryStats.Uid uid = mock(BatteryStats.Uid.class, RETURNS_DEEP_STUBS);
             doReturn(activityTime).when(mBatteryUtils).getForegroundActivityTotalTimeMs(eq(uid),
                     anyLong());
+            doReturn(topTime).when(mBatteryUtils).getProcessTimeMs(
+                    eq(BatteryUtils.StatusType.FOREGROUND), eq(uid), anyInt());
             doReturn(uidCode).when(uid).getUid();
             sipper.uidObj = uid;
         }
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
index 659b079..eb22d22 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/PowerUsageSummaryTest.java
@@ -16,6 +16,7 @@
 package com.android.settings.fuelgauge;
 
 import java.util.List;
+
 import android.app.LoaderManager;
 import android.content.Context;
 import android.content.Intent;
@@ -39,6 +40,7 @@
 import com.android.internal.os.BatteryStatsImpl;
 import com.android.settings.R;
 import com.android.settings.SettingsActivity;
+import com.android.settings.fuelgauge.anomaly.AnomalyDetectionPolicy;
 import com.android.settings.testutils.SettingsRobolectricTestRunner;
 import com.android.settings.TestConfig;
 import com.android.settings.Utils;
@@ -151,6 +153,8 @@
     private PreferenceScreen mPreferenceScreen;
     @Mock
     private PreferenceGroup mAppListGroup;
+    @Mock
+    private AnomalyDetectionPolicy mAnomalyDetectionPolicy;
 
     private List<BatterySipper> mUsageList;
     private Context mRealContext;
@@ -463,9 +467,9 @@
 
     @Test
     public void testInitAnomalyDetectionIfPossible_detectionEnabled_init() {
-        when(mFeatureFactory.powerUsageFeatureProvider.isAnomalyDetectionEnabled()).thenReturn(
-                true);
         doReturn(mLoaderManager).when(mFragment).getLoaderManager();
+        doReturn(mAnomalyDetectionPolicy).when(mFragment).getAnomalyDetectionPolicy();
+        when(mAnomalyDetectionPolicy.isAnomalyDetectionEnabled()).thenReturn(true);
 
         mFragment.initAnomalyDetectionIfPossible();
 
@@ -511,6 +515,27 @@
         assertThat(preference.showAnomalyIcon()).isTrue();
     }
 
+    @Test
+    public void testShouldHideSipper_typeOvercounted_returnTrue() {
+        mNormalBatterySipper.drainType = BatterySipper.DrainType.OVERCOUNTED;
+
+        assertThat(mFragment.shouldHideSipper(mNormalBatterySipper)).isTrue();
+    }
+
+    @Test
+    public void testShouldHideSipper_typeUnaccounted_returnTrue() {
+        mNormalBatterySipper.drainType = BatterySipper.DrainType.UNACCOUNTED;
+
+        assertThat(mFragment.shouldHideSipper(mNormalBatterySipper)).isTrue();
+    }
+
+    @Test
+    public void testShouldHideSipper_typeNormal_returnFalse() {
+        mNormalBatterySipper.drainType = BatterySipper.DrainType.APP;
+
+        assertThat(mFragment.shouldHideSipper(mNormalBatterySipper)).isFalse();
+    }
+
     public static class TestFragment extends PowerUsageSummary {
 
         private Context mContext;
diff --git a/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java
index 17fa17b..49fd214 100644
--- a/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/AssistGestureSettingsTest.java
@@ -57,7 +57,6 @@
 
     @Test
     public void testGetPreferenceScreenResId() {
-        when(mFeatureProvider.getPreferenceResourceId()).thenReturn(R.xml.assist_gesture_settings);
         assertThat(mSettings.getPreferenceScreenResId())
                 .isEqualTo(R.xml.assist_gesture_settings);
     }
@@ -76,7 +75,6 @@
                         ShadowApplication.getInstance().getApplicationContext(),
                         true /* enabled */);
 
-        when(mFeatureProvider.getPreferenceResourceId()).thenReturn(R.xml.assist_gesture_settings);
         assertThat(indexRes).isNotNull();
         assertThat(indexRes.get(0).xmlResId).isEqualTo(mSettings.getPreferenceScreenResId());
     }
diff --git a/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
index 6cf1cf4..26d9510 100644
--- a/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java
@@ -56,18 +56,6 @@
     }
 
     @Test
-    public void testPassNull_NoError() {
-        mProvider.setUpSearchMenu(null, null);
-    }
-
-    @Test
-    public void testSetUpMenu_HasItemAdded() {
-        mProvider.setUpSearchMenu(menu, mActivity);
-
-        verify(menu).add(anyInt(), anyInt(), anyInt(), anyString());
-    }
-
-    @Test
     public void getSiteMapManager_shouldCacheInstance() {
         final SiteMapManager manager1 = mProvider.getSiteMapManager();
         final SiteMapManager manager2 = mProvider.getSiteMapManager();
