Merge "Add Hearing Aid UI into Settings-Accessibility App"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index a275be0..ccdc2dc 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1917,7 +1917,7 @@
<activity android:name=".bluetooth.BluetoothPairingDialog"
android:excludeFromRecents="true"
android:windowSoftInputMode="stateVisible|adjustResize"
- android:theme="@*android:style/Theme.DeviceDefault.Settings.Dialog.NoActionBar">
+ android:theme="@style/Theme.AlertDialog">
<intent-filter android:priority="1">
<action android:name="android.bluetooth.device.action.PAIRING_REQUEST" />
<category android:name="android.intent.category.DEFAULT" />
@@ -1964,7 +1964,7 @@
android:excludeFromRecents="true"
android:exported="true"
android:permission="android.permission.DUMP"
- android:theme="@*android:style/Theme.DeviceDefault.Settings.Dialog.NoActionBar">
+ android:theme="@style/Theme.AlertDialog">
<intent-filter>
<action android:name="android.settings.SHOW_REMOTE_BUGREPORT_DIALOG" />
<category android:name="android.intent.category.DEFAULT" />
@@ -2660,7 +2660,7 @@
</activity>
<activity android:name=".sim.SimPreferenceDialog"
- android:theme="@*android:style/Theme.DeviceDefault.Settings.Dialog.NoActionBar"
+ android:theme="@style/Theme.AlertDialog"
android:excludeFromRecents="true" />
<activity
@@ -2690,7 +2690,7 @@
</activity>
<activity android:name=".sim.SimDialogActivity"
- android:theme="@*android:style/Theme.DeviceDefault.Settings.Dialog.NoActionBar"
+ android:theme="@style/Theme.AlertDialog"
android:label="@string/sim_settings_title"
android:excludeFromRecents="true">
<intent-filter>
diff --git a/res/drawable/ic_accessibility_illustration_colorblind.xml b/res/drawable/ic_accessibility_illustration_colorblind.xml
new file mode 100644
index 0000000..e2e73aa
--- /dev/null
+++ b/res/drawable/ic_accessibility_illustration_colorblind.xml
@@ -0,0 +1,67 @@
+<!--
+ ~ Copyright (C) 2018 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:viewportHeight="264.0"
+ android:viewportWidth="264.0">
+ <path android:fillColor="#FBBC04"
+ android:pathData="M112.52,208.91c-0.15,-0.9 -0.95,-1.54 -1.87,-1.51c-17.81,0.66 -36.14,-7.45 -51.36,-19.19c-24.31,-18.75 -40.49,-51.17 -34.81,-79.36l-3.53,-1.81c-24.28,31.54 -18.42,76.8 13.11,101.11c23.58,18.19 53.7,19.43 78.15,5.76L112.52,208.91z"/>
+ <path android:fillColor="#FDE293"
+ android:pathData="M44.48,195.92c18.36,14.16 46.39,20.23 66.95,18.26c1.04,-0.1 1.79,-1.05 1.62,-2.09l-0.52,-3.19c-0.15,-0.9 -0.95,-1.54 -1.87,-1.51c-17.81,0.66 -36.14,-7.45 -51.36,-19.19c-24.31,-18.75 -40.49,-51.17 -34.81,-79.36l-3.53,-1.81C9.98,136.93 15.03,173.21 44.48,195.92z"/>
+ <path android:fillColor="#6D4C41"
+ android:pathData="M20.8,107.25l1.15,-7.6c0.18,-1.17 1.42,-1.85 2.5,-1.38l3.31,1.44c1.01,0.44 1.39,1.67 0.81,2.6l-4.08,6.55L20.8,107.25z"/>
+ <path android:fillColor="#6D4C41"
+ android:pathData="M102,74.65l-0.03,2.62c-1.15,0.05 -2.31,0.04 -3.46,-0.02c-0.01,-0.04 0.01,-2.58 0,-2.62c-1.03,-7.56 0.59,-13.08 1.98,-16.21c0.35,-0.79 1.22,-1.2 2.05,-0.98c1.22,0.33 2.44,0.68 3.64,1.04c1.1,0.34 1.58,1.65 0.94,2.61C102.05,68.82 102,74.65 102,74.65z"/>
+ <path android:fillColor="#FEEFC3"
+ android:pathData="M148.04,97.35c-1.11,-13.75 -12.4,-24.77 -26.17,-25.59c-3.6,-0.21 -7.06,0.26 -10.28,1.29c-7.39,2.39 -15.3,2.33 -22.66,-0.15c-3.2,-1.08 -6.65,-1.6 -10.26,-1.43c-13.78,0.63 -25.21,11.5 -26.51,25.24c-0.47,4.97 0.38,9.7 2.22,13.9l-0.01,0l18.44,43.41c0.04,0.1 0.08,0.2 0.12,0.29l0.15,0.36l0.02,0c2.21,4.75 6.99,8.06 12.57,8.1c2.57,0.02 4.99,-0.66 7.07,-1.86c4.26,-2.46 9.62,-2.42 13.85,0.09c2.06,1.23 4.47,1.94 7.04,1.96c5.58,0.04 10.41,-3.21 12.68,-7.93l0.02,0l0.16,-0.36c0.04,-0.1 0.09,-0.19 0.13,-0.29l19.02,-43.16l-0.01,0C147.53,107.05 148.45,102.33 148.04,97.35z"/>
+ <path android:fillColor="#EA4335"
+ android:pathData="M79.99,77.27c2.43,0 4.81,0.39 7.08,1.16c4.34,1.47 8.86,2.21 13.42,2.21c4.38,0 8.71,-0.68 12.89,-2.03c2.18,-0.71 4.47,-1.06 6.79,-1.06c0.45,0 0.9,0.01 1.35,0.04c10.92,0.65 19.83,9.35 20.71,20.25c0.31,3.83 -0.33,7.53 -1.9,10.99l-3.94,8.69l0.13,-0.01l-15.22,34.54l-0.03,0.06l-0.02,0.04l0,0.01l-0.17,0.36c-1.38,2.86 -4.19,4.63 -7.34,4.63l-0.06,0c-1.45,-0.01 -2.87,-0.4 -4.1,-1.14c-3,-1.78 -6.45,-2.73 -9.98,-2.73c-3.44,0 -6.81,0.9 -9.75,2.6c-1.23,0.71 -2.63,1.08 -4.06,1.08l-0.06,0c-3.13,-0.02 -6,-1.88 -7.33,-4.73l-0.15,-0.33l-0.02,-0.05l-0.02,-0.05l-0.02,-0.05l-14.77,-34.77l0.13,0.01l-3.82,-8.71c-1.53,-3.48 -2.12,-7.19 -1.76,-11.02c1.03,-10.88 10.05,-19.47 20.98,-19.97C79.3,77.28 79.64,77.27 79.99,77.27L79.99,77.27M79.99,71.45c-0.44,0 -0.87,0.01 -1.31,0.03c-13.78,0.63 -25.21,11.5 -26.51,25.24c-0.47,4.97 0.38,9.7 2.22,13.9l-0.01,0l18.44,43.41c0.04,0.1 0.08,0.2 0.12,0.29l0.15,0.36l0.02,0c2.21,4.75 6.99,8.06 12.57,8.1c0.03,0 0.06,0 0.1,0c2.54,0 4.92,-0.68 6.97,-1.86c2.1,-1.21 4.47,-1.82 6.84,-1.82c2.43,0 4.86,0.64 7,1.91c2.06,1.23 4.47,1.94 7.04,1.96c0.03,0 0.06,0 0.1,0c5.54,0 10.33,-3.24 12.58,-7.93l0.02,0l0.16,-0.36c0.04,-0.1 0.09,-0.19 0.13,-0.29l19.02,-43.16l-0.01,0c1.9,-4.17 2.81,-8.9 2.41,-13.87c-1.11,-13.75 -12.4,-24.77 -26.17,-25.59c-0.57,-0.03 -1.13,-0.05 -1.69,-0.05c-2.99,0 -5.88,0.47 -8.58,1.35c-3.62,1.17 -7.36,1.75 -11.1,1.75c-3.9,0 -7.8,-0.63 -11.56,-1.9C86.13,71.96 83.12,71.45 79.99,71.45L79.99,71.45z"/>
+ <path android:fillColor="#FBBC04"
+ android:pathData="M87.76,114.52c-1.45,-0.01 -2.63,1.16 -2.64,2.6c-0.01,1.45 1.16,2.63 2.6,2.64c1.45,0.01 5.26,-2.59 5.26,-2.59S89.21,114.53 87.76,114.52z"/>
+ <path android:fillColor="#FBBC04"
+ android:pathData="M93.4,106.75c-1.02,-1.03 -2.68,-1.04 -3.71,-0.02c-1.03,1.02 -1.04,2.68 -0.02,3.71c1.02,1.03 5.55,1.89 5.55,1.89S94.42,107.78 93.4,106.75z"/>
+ <path android:fillColor="#FBBC04"
+ android:pathData="M93.26,128.06c-1.03,1.02 -2.69,1.01 -3.71,-0.02c-1.02,-1.03 -1.01,-2.69 0.02,-3.71c1.03,-1.02 5.57,-1.82 5.57,-1.82S94.29,127.04 93.26,128.06z"/>
+ <path android:fillColor="#EA4335"
+ android:pathData="M148.04,97.35c-1.11,-13.75 -12.4,-24.77 -26.17,-25.59c-3.6,-0.21 -7.06,0.26 -10.28,1.29c-3.69,1.19 -7.52,1.78 -11.34,1.75l-0.56,84.29c2.4,0.02 4.8,0.65 6.91,1.91c2.06,1.23 4.47,1.94 7.04,1.96c5.58,0.04 10.41,-3.21 12.68,-7.93l0.02,0l0.16,-0.36c0.04,-0.1 0.09,-0.19 0.13,-0.29l19.02,-43.16l-0.01,0C147.53,107.05 148.45,102.33 148.04,97.35z"/>
+ <path android:fillColor="#9CCC65"
+ android:pathData="M169.25,173.55c-0.75,-0.24 -1.54,-0.38 -2.37,-0.37c-4.11,0.03 -7.42,3.38 -7.39,7.49C164.05,180.63 167.9,177.65 169.25,173.55z"/>
+ <path android:fillColor="#9CCC65"
+ android:pathData="M149.06,170.38c0.04,5.72 4.71,10.33 10.43,10.29C159.45,174.94 154.78,170.34 149.06,170.38z"/>
+ <path android:fillColor="#F57C00"
+ android:pathData="M128.64,213.24a31.07,31.07 0,1 0,62.14 -0.42a31.07,31.07 0,1 0,-62.14 0.42z"/>
+ <path android:fillColor="#9CCC65"
+ android:pathData="M153.74,20.13c-1.04,0.17 -1.87,0.99 -2.04,2.04c-0.86,5.29 0.73,10.9 4.81,14.97s9.69,5.67 14.97,4.81c1.04,-0.17 1.87,-0.99 2.04,-2.04c0.86,-5.29 -0.73,-10.9 -4.81,-14.97C164.64,20.86 159.03,19.27 153.74,20.13z"/>
+ <path android:fillColor="#3949AB"
+ android:pathData="M158.58,69.64a12.99,12.99 62.72,1 0,4.91 -25.51a12.99,12.99 62.72,1 0,-4.91 25.51z"/>
+ <path android:fillColor="#1A237E"
+ android:pathData="M159.66,51.83l2.66,2.78l3.74,0.91l-2.78,2.66l-0.91,3.75l-2.66,-2.79l-3.74,-0.91l2.78,-2.66z"/>
+ <path android:fillColor="#3949AB"
+ android:pathData="M185.95,62.31a12.99,12.99 114.61,1 0,4.91 -25.51a12.99,12.99 62.72,1 0,-4.91 25.51z"/>
+ <path android:fillColor="#1A237E"
+ android:pathData="M187.03,44.49l2.66,2.79l3.74,0.91l-2.78,2.66l-0.91,3.74l-2.66,-2.78l-3.74,-0.91l2.78,-2.66z"/>
+ <path android:fillColor="#3949AB"
+ android:pathData="M169.42,83.27a12.99,12.99 87.23,1 0,21.51 -14.57a12.99,12.99 123.26,1 0,-21.51 14.57z"/>
+ <path android:fillColor="#1A237E"
+ android:pathData="M182.79,71.45l-0.09,3.85l2,3.29l-3.85,-0.09l-3.29,2l0.09,-3.85l-2,-3.29l3.85,0.09z"/>
+ <path android:fillColor="#8D6E63"
+ android:pathData="M242.38,62.35c0.98,2.75 2.3,9.01 -1.42,17.85l2.91,0.73c0,0 5.93,-9.31 4.14,-20.42c-0.2,-1.27 -1.58,-2 -2.76,-1.49c-0.72,0.31 -1.35,0.61 -1.88,0.87C242.47,60.35 242.04,61.4 242.38,62.35z"/>
+ <path android:fillColor="#9CCC65"
+ android:pathData="M255.94,108.8c2.85,-6.33 2.91,-13.91 -0.73,-20.75c-4.98,-9.36 -15.93,-14.24 -26.21,-11.7c-7.34,1.81 -12.85,6.72 -15.72,12.86c-4.4,9.42 -11.23,17.6 -19.98,23.21c-7.06,4.53 -12.73,11.42 -15.69,20.17c-5.98,17.69 1.9,37.45 18.39,46.22c19.93,10.6 44.32,1.98 53.36,-18.29c3.05,-6.84 3.95,-14.1 2.98,-21.01C250.87,129.11 251.62,118.38 255.94,108.8z"/>
+ <path android:fillColor="#81C995"
+ android:pathData="M252.33,139.52c-1.46,-10.41 -0.71,-21.14 3.61,-30.72c2.85,-6.33 2.91,-13.91 -0.73,-20.75c-0.9,-1.69 -1.99,-3.22 -3.24,-4.6c1.62,5.53 1.11,11.25 -1.12,16.2c-4.32,9.59 -5.07,20.31 -3.61,30.72c0.97,6.91 0.08,14.17 -2.98,21.01c-9.04,20.26 -33.43,28.89 -53.36,18.29c-5.07,-2.7 -9.32,-6.43 -12.61,-10.83c3.26,8.34 9.38,15.56 17.7,19.98c19.93,10.6 44.32,1.98 53.36,-18.29C252.41,153.69 253.31,146.43 252.33,139.52z"/>
+</vector>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 3bf36ba9..63944d9 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -165,12 +165,28 @@
<item name="android:windowNoTitle">true</item>
</style>
- <style name="Theme.Settings.Home" parent="Theme.AppCompat.Light.NoActionBar">
+ <style name="Theme.Settings.Home" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Color names copied from frameworks/base/core/res/res/values/themes_device_defaults.xml -->
<item name="colorPrimary">@*android:color/primary_device_default_settings_light</item>
<item name="colorPrimaryDark">@*android:color/primary_dark_device_default_settings_light</item>
- <item name="android:colorAccent">@*android:color/accent_device_default_light</item>
+ <item name="colorAccent">@*android:color/accent_device_default_light</item>
+ </style>
+
+ <!--TODO(b/111875856) This theme will be useless, when we add real activity/fragment to handle the full screen for WifiDialog -->
+ <style name="Theme.Settings.WifiDialogFullScreen" parent="Theme.AppCompat.DayNight.NoActionBar">
+ <!-- Color names copied from frameworks/base/core/res/res/values/themes_device_defaults.xml -->
+ <item name="colorPrimary">@*android:color/primary_device_default_settings_light</item>
+ <item name="colorPrimaryDark">@*android:color/primary_dark_device_default_settings_light</item>
+ <item name="colorAccent">@*android:color/accent_device_default_light</item>
+
+ <!-- Add white nav bar with divider that matches material -->
+ <item name="android:navigationBarDividerColor">@color/ripple_material_light</item>
+ <item name="android:navigationBarColor">@android:color/white</item>
+ <item name="android:windowLightNavigationBar">true</item>
<item name="android:windowLightStatusBar">true</item>
+
+ <!-- For AndroidX AlertDialog -->
+ <item name="alertDialogTheme">@style/Theme.AlertDialog</item>
</style>
</resources>
diff --git a/res/xml/accessibility_daltonizer_settings.xml b/res/xml/accessibility_daltonizer_settings.xml
index fc26fd3..9cd3865 100644
--- a/res/xml/accessibility_daltonizer_settings.xml
+++ b/res/xml/accessibility_daltonizer_settings.xml
@@ -24,6 +24,7 @@
android:entryValues="@array/daltonizer_type_values"
android:key="type"
android:summary="%s"
- android:title="@string/daltonizer_type" />
+ android:title="@string/daltonizer_type"
+ android:icon="@drawable/ic_accessibility_illustration_colorblind" />
</PreferenceScreen>
diff --git a/src/com/android/settings/bluetooth/BluetoothFeatureProvider.java b/src/com/android/settings/bluetooth/BluetoothFeatureProvider.java
deleted file mode 100644
index a6ae31c..0000000
--- a/src/com/android/settings/bluetooth/BluetoothFeatureProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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;
-
-/**
- * Feature provider for bluetooth feature
- */
-public interface BluetoothFeatureProvider {
- /**
- * @return whether additional pairing page is enabled
- */
- boolean isPairingPageEnabled();
-
- /**
- * @return whether device details should be shown as a separate page (true) or a dialog (false)
- */
- boolean isDeviceDetailPageEnabled();
-}
diff --git a/src/com/android/settings/bluetooth/BluetoothFeatureProviderImpl.java b/src/com/android/settings/bluetooth/BluetoothFeatureProviderImpl.java
deleted file mode 100644
index c4962d6..0000000
--- a/src/com/android/settings/bluetooth/BluetoothFeatureProviderImpl.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.android.settings.bluetooth;
-
-/**
- * Impl for bluetooth feature provider
- */
-public class BluetoothFeatureProviderImpl implements BluetoothFeatureProvider {
-
- @Override
- public boolean isPairingPageEnabled() {
- return false;
- }
-
- @Override
- public boolean isDeviceDetailPageEnabled() {
- return false;
- }
-}
\ No newline at end of file
diff --git a/src/com/android/settings/development/autofill/AutofillPreferenceCategory.java b/src/com/android/settings/development/autofill/AutofillPreferenceCategory.java
index ed07f62..711100d 100644
--- a/src/com/android/settings/development/autofill/AutofillPreferenceCategory.java
+++ b/src/com/android/settings/development/autofill/AutofillPreferenceCategory.java
@@ -19,6 +19,7 @@
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
+import android.os.Looper;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.AttributeSet;
@@ -30,22 +31,23 @@
public final class AutofillPreferenceCategory extends PreferenceCategory {
private static final String TAG = "AutofillPreferenceCategory";
+ private static final long DELAYED_MESSAGE_TIME_MS = 2000;
private final ContentResolver mContentResolver;
private final ContentObserver mSettingsObserver;
+ private final Handler mHandler = new Handler(Looper.getMainLooper());
public AutofillPreferenceCategory(Context context, AttributeSet attrs) {
super(context, attrs);
- mSettingsObserver = new ContentObserver(new Handler()) {
+ mSettingsObserver = new ContentObserver(mHandler) {
@Override
public void onChange(boolean selfChange, Uri uri, int userId) {
- Log.w(TAG, "Autofill Service changed, but UI cannot be refreshed");
- // TODO(b/111838239): we cannot update the UI because AFM.isEnabled() will return
- // the previous value. Once that's fixed, we'll need to call one of the 2 callbacks
- // below:
- // notifyChanged();
- // notifyDependencyChange(shouldDisableDependents());
+ // We cannot apply the change yet because AutofillManager.isEnabled() state is
+ // updated by a ContentObserver as well and there's no guarantee of which observer
+ // is called first - hence, it's possible that the state didn't change here yet.
+ mHandler.postDelayed(() -> notifyDependencyChange(shouldDisableDependents()),
+ DELAYED_MESSAGE_TIME_MS);
}
};
mContentResolver = context.getContentResolver();
diff --git a/src/com/android/settings/overlay/FeatureFactory.java b/src/com/android/settings/overlay/FeatureFactory.java
index 72bac99..ef8d1ee 100644
--- a/src/com/android/settings/overlay/FeatureFactory.java
+++ b/src/com/android/settings/overlay/FeatureFactory.java
@@ -23,7 +23,6 @@
import com.android.settings.R;
import com.android.settings.accounts.AccountFeatureProvider;
import com.android.settings.applications.ApplicationFeatureProvider;
-import com.android.settings.bluetooth.BluetoothFeatureProvider;
import com.android.settings.dashboard.DashboardFeatureProvider;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
@@ -103,8 +102,6 @@
public abstract UserFeatureProvider getUserFeatureProvider(Context context);
- public abstract BluetoothFeatureProvider getBluetoothFeatureProvider(Context context);
-
public abstract SlicesFeatureProvider getSlicesFeatureProvider();
public abstract AccountFeatureProvider getAccountFeatureProvider();
diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.java b/src/com/android/settings/overlay/FeatureFactoryImpl.java
index 48d563f..61be109 100644
--- a/src/com/android/settings/overlay/FeatureFactoryImpl.java
+++ b/src/com/android/settings/overlay/FeatureFactoryImpl.java
@@ -22,12 +22,12 @@
import android.net.ConnectivityManager;
import android.os.UserManager;
+import androidx.annotation.Keep;
+
import com.android.settings.accounts.AccountFeatureProvider;
import com.android.settings.accounts.AccountFeatureProviderImpl;
import com.android.settings.applications.ApplicationFeatureProvider;
import com.android.settings.applications.ApplicationFeatureProviderImpl;
-import com.android.settings.bluetooth.BluetoothFeatureProvider;
-import com.android.settings.bluetooth.BluetoothFeatureProviderImpl;
import com.android.settings.connecteddevice.dock.DockUpdaterFeatureProviderImpl;
import com.android.settings.dashboard.DashboardFeatureProvider;
import com.android.settings.dashboard.DashboardFeatureProviderImpl;
@@ -53,8 +53,6 @@
import com.android.settings.users.UserFeatureProviderImpl;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
-import androidx.annotation.Keep;
-
/**
* {@link FeatureFactory} implementation for AOSP Settings.
*/
@@ -73,7 +71,6 @@
private PowerUsageFeatureProvider mPowerUsageFeatureProvider;
private AssistGestureFeatureProvider mAssistGestureFeatureProvider;
private UserFeatureProvider mUserFeatureProvider;
- private BluetoothFeatureProvider mBluetoothFeatureProvider;
private SlicesFeatureProvider mSlicesFeatureProvider;
private AccountFeatureProvider mAccountFeatureProvider;
private DeviceIndexFeatureProviderImpl mDeviceIndexFeatureProvider;
@@ -192,14 +189,6 @@
}
@Override
- public BluetoothFeatureProvider getBluetoothFeatureProvider(Context context) {
- if (mBluetoothFeatureProvider == null) {
- mBluetoothFeatureProvider = new BluetoothFeatureProviderImpl();
- }
- return mBluetoothFeatureProvider;
- }
-
- @Override
public AssistGestureFeatureProvider getAssistGestureFeatureProvider() {
if (mAssistGestureFeatureProvider == null) {
mAssistGestureFeatureProvider = new AssistGestureFeatureProviderImpl();
diff --git a/src/com/android/settings/wifi/WifiDialog.java b/src/com/android/settings/wifi/WifiDialog.java
index a487017..6e94a06 100644
--- a/src/com/android/settings/wifi/WifiDialog.java
+++ b/src/com/android/settings/wifi/WifiDialog.java
@@ -50,12 +50,12 @@
private WifiConfigController mController;
private boolean mHideSubmitButton;
-
+ // TODO(b/111875856) WifiDialog should not mimic full screen UI.
/** Creates a WifiDialog with fullscreen style. It displays in fullscreen mode. */
public static WifiDialog createFullscreen(Context context, WifiDialogListener listener,
AccessPoint accessPoint, int mode) {
return new WifiDialog(context, listener, accessPoint, mode,
- R.style.Theme_Settings_NoActionBar, false /* hideSubmitButton */);
+ R.style.Theme_Settings_WifiDialogFullScreen, false /* hideSubmitButton */);
}
/**
diff --git a/src/com/android/settings/wifi/WifiDialogActivity.java b/src/com/android/settings/wifi/WifiDialogActivity.java
index e5526c9..d864855 100644
--- a/src/com/android/settings/wifi/WifiDialogActivity.java
+++ b/src/com/android/settings/wifi/WifiDialogActivity.java
@@ -52,6 +52,8 @@
@VisibleForTesting
static final String KEY_CONNECT_FOR_CALLER = "connect_for_caller";
+ private WifiDialog mDialog;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
final Intent intent = getIntent();
@@ -67,10 +69,10 @@
accessPoint = new AccessPoint(this, accessPointState);
}
- WifiDialog dialog = WifiDialog.createModal(
+ mDialog = WifiDialog.createModal(
this, this, accessPoint, WifiConfigUiBase.MODE_CONNECT);
- dialog.show();
- dialog.setOnDismissListener(this);
+ mDialog.show();
+ mDialog.setOnDismissListener(this);
}
@Override
@@ -80,6 +82,15 @@
}
@Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (mDialog != null && mDialog.isShowing()) {
+ mDialog.dismiss();
+ mDialog = null;
+ }
+ }
+
+ @Override
public void onForget(WifiDialog dialog) {
final WifiManager wifiManager = getSystemService(WifiManager.class);
final AccessPoint accessPoint = dialog.getController().getAccessPoint();
@@ -147,6 +158,7 @@
@Override
public void onDismiss(DialogInterface dialogInterface) {
+ mDialog = null;
finish();
}
}
diff --git a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
index 56df664..39d4417 100644
--- a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
+++ b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java
@@ -23,7 +23,6 @@
import com.android.settings.accounts.AccountFeatureProvider;
import com.android.settings.applications.ApplicationFeatureProvider;
-import com.android.settings.bluetooth.BluetoothFeatureProvider;
import com.android.settings.dashboard.DashboardFeatureProvider;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
@@ -62,7 +61,6 @@
public final SuggestionFeatureProvider suggestionsFeatureProvider;
public final UserFeatureProvider userFeatureProvider;
public final AssistGestureFeatureProvider assistGestureFeatureProvider;
- public final BluetoothFeatureProvider bluetoothFeatureProvider;
public final AccountFeatureProvider mAccountFeatureProvider;
public final DeviceIndexFeatureProvider deviceIndexFeatureProvider;
@@ -104,7 +102,6 @@
suggestionsFeatureProvider = mock(SuggestionFeatureProvider.class);
userFeatureProvider = mock(UserFeatureProvider.class);
assistGestureFeatureProvider = mock(AssistGestureFeatureProvider.class);
- bluetoothFeatureProvider = mock(BluetoothFeatureProvider.class);
slicesFeatureProvider = mock(SlicesFeatureProvider.class);
mAccountFeatureProvider = mock(AccountFeatureProvider.class);
deviceIndexFeatureProvider = mock(DeviceIndexFeatureProvider.class);
@@ -176,11 +173,6 @@
}
@Override
- public BluetoothFeatureProvider getBluetoothFeatureProvider(Context context) {
- return bluetoothFeatureProvider;
- }
-
- @Override
public AssistGestureFeatureProvider getAssistGestureFeatureProvider() {
return assistGestureFeatureProvider;
}
diff --git a/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java b/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java
index 7a88131..74378bd 100644
--- a/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/WifiDialogTest.java
@@ -37,7 +37,7 @@
WifiDialog fullscreen = WifiDialog.createFullscreen(mContext, mListener, mockAccessPoint,
WifiConfigUiBase.MODE_CONNECT);
assertThat(fullscreen.getContext().getThemeResId())
- .isEqualTo(R.style.Theme_Settings_NoActionBar);
+ .isEqualTo(R.style.Theme_Settings_WifiDialogFullScreen);
}
@Test