Merge "Update texts for Settings->Sound->Do not disturb"
diff --git a/res/drawable/button_bg_transparent.xml b/res/drawable/button_bg_transparent.xml
deleted file mode 100644
index d9c6fc8..0000000
--- a/res/drawable/button_bg_transparent.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:insetLeft="4dp"
- android:insetTop="6dp"
- android:insetRight="4dp"
- android:insetBottom="6dp">
- <ripple android:color="?android:attr/colorControlHighlight">
- <item android:id="@android:id/mask">
- <shape android:shape="rectangle">
- <corners android:radius="2dp"/>
- <solid android:color="@android:color/white"/>
- </shape>
- </item>
- <item>
- <shape android:shape="rectangle">
- <solid android:color="#00ffffff"/>
- <!--make button border solid color, nontransparent-->
- <stroke android:color="?android:attr/colorAccent" android:width="1dp"/>
- <corners android:radius="2dp"/>
- </shape>
- </item>
- </ripple>
-</inset>
\ No newline at end of file
diff --git a/res/layout/app_details.xml b/res/layout/app_details.xml
index 3088865..263ce05 100644
--- a/res/layout/app_details.xml
+++ b/res/layout/app_details.xml
@@ -29,15 +29,13 @@
android:paddingBottom="24dp" >
<!-- App snippet with buttons -->
- <LinearLayout
+ <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingStart="8dp"
- android:paddingEnd="8dp"
- android:orientation="horizontal">
+ android:paddingStart="8dp">
<ImageView
- android:id="@android:id/icon"
+ android:id="@+id/app_detail_icon"
android:layout_width="80dp"
android:layout_height="80dp"
android:scaleType="fitXY"
@@ -47,12 +45,13 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_toEndOf="@id/app_detail_icon"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:orientation="vertical">
<TextView
- android:id="@android:id/title"
+ android:id="@+id/app_detail_title"
style="@style/TextAppearance.EntityHeaderTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -62,7 +61,7 @@
android:paddingTop="8dp"/>
<TextView
- android:id="@android:id/summary"
+ android:id="@+id/app_detail_summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
@@ -73,7 +72,33 @@
</LinearLayout>
- </LinearLayout>
+ <LinearLayout
+ android:id="@+id/app_detail_links"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignParentEnd="true"
+ android:orientation="vertical">
+
+ <ImageButton
+ android:id="@+id/right_button"
+ style="@android:style/Widget.Material.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_weight="1"
+ android:layout_height="0dp"
+ android:src="@drawable/ic_settings_24dp"
+ android:tint="?android:attr/colorAccent"/>
+
+ <ImageButton
+ android:id="@+id/left_button"
+ style="@android:style/Widget.Material.Button.Borderless"
+ android:layout_width="wrap_content"
+ android:layout_weight="1"
+ android:layout_height="0dp"
+ android:tint="?android:attr/colorAccent"/>
+
+ </LinearLayout>
+
+ </RelativeLayout>
<TextView
android:id="@+id/instant_app_developer_title"
@@ -109,37 +134,4 @@
android:gravity="center_horizontal"
android:visibility="gone"/>
-
- <LinearLayout
- android:id="@+id/app_detail_links"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="bottom"
- android:paddingStart="8dp"
- android:paddingEnd="8dp"
- android:orientation="horizontal">
-
- <ImageButton
- android:id="@+id/left_button"
- style="@style/AppHeaderLinkButton"
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:paddingEnd="8dp"
- android:tint="?android:attr/colorAccent"/>
-
- <ImageButton
- android:id="@+id/right_button"
- style="@style/AppHeaderLinkButton"
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:paddingStart="8dp"
- android:src="@drawable/ic_settings_24dp"
- android:tint="?android:attr/colorAccent"/>
-
- </LinearLayout>
-
</LinearLayout>
\ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3af7f05..71ef973 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5585,10 +5585,8 @@
<string name="user_remove_user_menu">Delete <xliff:g id="user_name">%1$s</xliff:g> from this device</string>
<!-- User lock screen settings header[CHAR LIMIT=40] -->
<string name="user_lockscreen_settings">Lock screen settings</string>
- <!-- User settings item to allow creating new users from locks creen [CHAR LIMIT=40] -->
- <string name="user_add_on_lockscreen_menu">Add users</string>
- <!-- User settings user_add_on_lockscreen_menu item summary [CHAR LIMIT=40] -->
- <string name="user_add_on_lockscreen_menu_summary">when device is locked</string>
+ <!-- User settings item to allow creating new users from locks screen [CHAR LIMIT=50] -->
+ <string name="user_add_on_lockscreen_menu">Add users from lock screen</string>
<!-- User details new user name [CHAR LIMIT=30] -->
<string name="user_new_user_name">New user</string>
<!-- User details new restricted profile name [CHAR LIMIT=30] -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 2f6f120..3f36255 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -428,9 +428,5 @@
<item name="android:textSize">24sp</item>
</style>
- <style name="AppHeaderLinkButton" parent="android:Widget.Material.Button.Borderless">
- <item name="android:background">@drawable/button_bg_transparent</item>
- </style>
-
<style name="AppActionPrimaryButton" parent="android:Widget.Material.Button.Colored"/>
</resources>
diff --git a/res/xml/ia_display_settings.xml b/res/xml/ia_display_settings.xml
index ed026f1..cb58ef2 100644
--- a/res/xml/ia_display_settings.xml
+++ b/res/xml/ia_display_settings.xml
@@ -110,12 +110,6 @@
android:title="@string/device_theme"
android:summary="%s" />
- <Preference
- android:key="wifi_display"
- android:title="@string/wifi_display_settings_title"
- settings:keywords="@string/keywords_display_cast_screen"
- android:fragment="com.android.settings.wfd.WifiDisplaySettings" />
-
<DropDownPreference
android:key="vr_display_pref"
android:summary="%s"
diff --git a/res/xml/ia_sound_settings.xml b/res/xml/ia_sound_settings.xml
index e63db0d..27fcdda 100644
--- a/res/xml/ia_sound_settings.xml
+++ b/res/xml/ia_sound_settings.xml
@@ -60,32 +60,34 @@
<PreferenceCategory
android:key="ringtones_preferecence_category"
- android:title="@string/ringtones_category_preference_title" />
+ android:title="@string/ringtones_category_preference_title" >
- <!-- Phone ringtone -->
- <com.android.settings.DefaultRingtonePreference
- android:key="ringtone"
- android:title="@string/ringtone_title"
- android:dialogTitle="@string/ringtone_title"
- android:summary="@string/ringtone_summary"
- android:ringtoneType="ringtone" />
+ <!-- Phone ringtone -->
+ <com.android.settings.DefaultRingtonePreference
+ android:key="ringtone"
+ android:title="@string/ringtone_title"
+ android:dialogTitle="@string/ringtone_title"
+ android:summary="@string/ringtone_summary"
+ android:ringtoneType="ringtone" />
- <!-- Default notification ringtone -->
- <com.android.settings.DefaultRingtonePreference
- android:key="notification_ringtone"
- android:title="@string/notification_ringtone_title"
- android:dialogTitle="@string/notification_ringtone_title"
- android:summary="@string/ringtone_summary"
- android:ringtoneType="notification" />
+ <!-- Default notification ringtone -->
+ <com.android.settings.DefaultRingtonePreference
+ android:key="notification_ringtone"
+ android:title="@string/notification_ringtone_title"
+ android:dialogTitle="@string/notification_ringtone_title"
+ android:summary="@string/ringtone_summary"
+ android:ringtoneType="notification" />
- <!-- Default alarm ringtone -->
- <com.android.settings.DefaultRingtonePreference
- android:key="alarm_ringtone"
- android:title="@string/alarm_ringtone_title"
- android:dialogTitle="@string/alarm_ringtone_title"
- android:summary="@string/ringtone_summary"
- android:persistent="false"
- android:ringtoneType="alarm" />
+ <!-- Default alarm ringtone -->
+ <com.android.settings.DefaultRingtonePreference
+ android:key="alarm_ringtone"
+ android:title="@string/alarm_ringtone_title"
+ android:dialogTitle="@string/alarm_ringtone_title"
+ android:summary="@string/ringtone_summary"
+ android:persistent="false"
+ android:ringtoneType="alarm" />
+
+ </PreferenceCategory>
<!-- Other sounds -->
<PreferenceCategory
diff --git a/res/xml/installed_app_details_ia.xml b/res/xml/installed_app_details_ia.xml
index e72384a..af3a851 100644
--- a/res/xml/installed_app_details_ia.xml
+++ b/res/xml/installed_app_details_ia.xml
@@ -20,7 +20,8 @@
<com.android.settings.applications.LayoutPreference
android:key="header_view"
android:layout="@layout/app_details"
- android:selectable="false"/>
+ android:selectable="false"
+ android:order="-10000"/>
<Preference
android:key="notification_settings"
diff --git a/res/xml/user_and_accounts_settings.xml b/res/xml/user_and_accounts_settings.xml
index 9bb39f6..bc3ac6c 100644
--- a/res/xml/user_and_accounts_settings.xml
+++ b/res/xml/user_and_accounts_settings.xml
@@ -49,8 +49,6 @@
<com.android.settingslib.RestrictedSwitchPreference
android:key="add_users_when_locked"
android:title="@string/user_add_on_lockscreen_menu"
- android:summary="@string/user_add_on_lockscreen_menu_summary"
- settings:useAdditionalSummary="true"
android:order="105"/>
<PreferenceCategory
diff --git a/res/xml/user_settings.xml b/res/xml/user_settings.xml
index 1375ed4..45d0b90 100644
--- a/res/xml/user_settings.xml
+++ b/res/xml/user_settings.xml
@@ -33,9 +33,7 @@
android:title="@string/user_lockscreen_settings">
<com.android.settingslib.RestrictedSwitchPreference
android:key="add_users_when_locked"
- android:title="@string/user_add_on_lockscreen_menu"
- android:summary="@string/user_add_on_lockscreen_menu_summary"
- settings:useAdditionalSummary="true" />
+ android:title="@string/user_add_on_lockscreen_menu" />
</PreferenceCategory>
<Preference
android:key="emergency_info"
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index eeb4779..ddf0dec 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -1164,7 +1164,7 @@
void setImsConfigProvisionedState(int configItem, boolean state) {
if (phone != null && mImsManager != null) {
- QueuedWork.singleThreadExecutor().submit(new Runnable() {
+ QueuedWork.queue(new Runnable() {
public void run() {
try {
mImsManager.getConfigInterface().setProvisionedValue(
@@ -1174,7 +1174,7 @@
Log.e(TAG, "setImsConfigProvisioned() exception:", e);
}
}
- });
+ }, false);
}
}
diff --git a/src/com/android/settings/UserCredentialsSettings.java b/src/com/android/settings/UserCredentialsSettings.java
index c473182..ea9eee9 100644
--- a/src/com/android/settings/UserCredentialsSettings.java
+++ b/src/com/android/settings/UserCredentialsSettings.java
@@ -264,10 +264,16 @@
final SortedMap<String, Credential> aliasMap = new TreeMap<>();
for (final Credential.Type type : Credential.Type.values()) {
for (final String alias : keyStore.list(type.prefix, uid)) {
- // Do not show work profile keys in user credentials
- if (alias.startsWith(LockPatternUtils.PROFILE_KEY_NAME_ENCRYPT) ||
- alias.startsWith(LockPatternUtils.PROFILE_KEY_NAME_DECRYPT)) {
- continue;
+ if (UserHandle.getAppId(uid) == Process.SYSTEM_UID) {
+ // Do not show work profile keys in user credentials
+ if (alias.startsWith(LockPatternUtils.PROFILE_KEY_NAME_ENCRYPT) ||
+ alias.startsWith(LockPatternUtils.PROFILE_KEY_NAME_DECRYPT)) {
+ continue;
+ }
+ // Do not show synthetic password keys in user credential
+ if (alias.startsWith(LockPatternUtils.SYNTHETIC_PASSWORD_KEY_PREFIX)) {
+ continue;
+ }
}
Credential c = aliasMap.get(alias);
if (c == null) {
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index 253ed76..32dc0c3 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -216,56 +216,4 @@
protected int getHelpResource() {
return R.string.help_url_more_networks;
}
-
- /**
- * For Search.
- */
- public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
- new BaseSearchIndexProvider() {
- @Override
- public List<SearchIndexableResource> getXmlResourcesToIndex(
- Context context, boolean enabled) {
- // Remove wireless settings from search in demo mode
- if (UserManager.isDeviceInDemoMode(context)) {
- return Collections.emptyList();
- }
- SearchIndexableResource sir = new SearchIndexableResource(context);
- sir.xmlResId = R.xml.wireless_settings;
- return Arrays.asList(sir);
- }
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- final ArrayList<String> result = new ArrayList<String>();
-
- final UserManager um = (UserManager) context.getSystemService(
- Context.USER_SERVICE);
- final boolean isSecondaryUser = !um.isAdminUser();
- final boolean isWimaxEnabled = !isSecondaryUser
- && context.getResources().getBoolean(
- com.android.internal.R.bool.config_wimaxEnabled);
- if (!isWimaxEnabled) {
- result.add(KEY_WIMAX_SETTINGS);
- }
-
- new VpnPreferenceController(context).updateNonIndexableKeys(result);
-
- new NfcPreferenceController(context).updateNonIndexableKeys(result);
- new MobilePlanPreferenceController(context, null /* MobilePlanClickHandler */)
- .updateNonIndexableKeys(result);
- new MobileNetworkPreferenceController(context)
- .updateNonIndexableKeys(result);
-
- // Remove Airplane Mode settings if it's a stationary device such as a TV.
- new AirplaneModePreferenceController(context, null /* fragment */)
- .updateNonIndexableKeys(result);
-
- new ProxyPreferenceController(context).updateNonIndexableKeys(result);
-
- new TetherPreferenceController(context).updateNonIndexableKeys(result);
- new WifiCallingPreferenceController(context).updateNonIndexableKeys(result);
-
- return result;
- }
- };
}
diff --git a/src/com/android/settings/applications/AppHeaderController.java b/src/com/android/settings/applications/AppHeaderController.java
index 5b243ff..daafc18 100644
--- a/src/com/android/settings/applications/AppHeaderController.java
+++ b/src/com/android/settings/applications/AppHeaderController.java
@@ -163,17 +163,17 @@
final Resources res = mAppHeader.getResources();
// Set Icon
- final ImageView iconView = (ImageView) mAppHeader.findViewById(android.R.id.icon);
+ final ImageView iconView = (ImageView) mAppHeader.findViewById(R.id.app_detail_icon);
if (appEntry.icon != null) {
iconView.setImageDrawable(appEntry.icon.getConstantState().newDrawable(res));
}
// Set application name.
- final TextView labelView = (TextView) mAppHeader.findViewById(android.R.id.title);
+ final TextView labelView = (TextView) mAppHeader.findViewById(R.id.app_detail_title);
labelView.setText(appEntry.label);
// Version number of application
- final TextView appVersion = (TextView) mAppHeader.findViewById(android.R.id.summary);
+ final TextView appVersion = (TextView) mAppHeader.findViewById(R.id.app_detail_summary);
if (!TextUtils.isEmpty(versionName)) {
appVersion.setSelected(true);
@@ -206,12 +206,12 @@
* Done mutating appheader, rebinds everything (optionally skip rebinding buttons).
*/
public View done(boolean rebindActions) {
- ImageView iconView = (ImageView) mAppHeader.findViewById(android.R.id.icon);
+ ImageView iconView = (ImageView) mAppHeader.findViewById(R.id.app_detail_icon);
if (iconView != null) {
iconView.setImageDrawable(mIcon);
}
- setText(android.R.id.title, mLabel);
- setText(android.R.id.summary, mSummary);
+ setText(R.id.app_detail_title, mLabel);
+ setText(R.id.app_detail_summary, mSummary);
if (rebindActions) {
bindAppHeaderButtons();
}
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index 873c5fd..73164e4 100755
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -327,7 +327,7 @@
addDynamicPrefs();
if (mDashboardFeatureProvider.isEnabled()) {
mFooter = new LayoutPreference(getPrefContext(), R.layout.app_action_buttons);
- mFooter.setOrder(10000);
+ mFooter.setOrder(-9999);
mFooter.setKey(KEY_FOOTER);
getPreferenceScreen().addPreference(mFooter);
}
@@ -1098,10 +1098,10 @@
LayoutInflater.from(appSnippet.getContext()).inflate(R.layout.widget_text_views,
(ViewGroup) appSnippet.findViewById(android.R.id.widget_frame));
- ImageView iconView = (ImageView) appSnippet.findViewById(android.R.id.icon);
+ ImageView iconView = (ImageView) appSnippet.findViewById(R.id.app_detail_icon);
iconView.setImageDrawable(icon);
// Set application name.
- TextView labelView = (TextView) appSnippet.findViewById(android.R.id.title);
+ TextView labelView = (TextView) appSnippet.findViewById(R.id.app_detail_title);
labelView.setText(label);
// Version number of application
TextView appVersion = (TextView) appSnippet.findViewById(R.id.widget_text1);
diff --git a/src/com/android/settings/core/instrumentation/EventLogWriter.java b/src/com/android/settings/core/instrumentation/EventLogWriter.java
index de37cba..9304512 100644
--- a/src/com/android/settings/core/instrumentation/EventLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/EventLogWriter.java
@@ -17,8 +17,10 @@
package com.android.settings.core.instrumentation;
import android.content.Context;
+import android.metrics.LogMaker;
import com.android.internal.logging.MetricsLogger;
+import com.android.internal.logging.nano.MetricsProto;
/**
* {@link LogWriter} that writes data to eventlog.
@@ -37,6 +39,15 @@
MetricsLogger.action(context, category, "");
}
+ public void actionWithSource(Context context, int source, int category) {
+ final LogMaker logMaker = new LogMaker(category)
+ .setType(MetricsProto.MetricsEvent.TYPE_ACTION);
+ if (source != MetricsProto.MetricsEvent.VIEW_UNKNOWN) {
+ logMaker.addTaggedData(MetricsProto.MetricsEvent.FIELD_CONTEXT, source);
+ }
+ MetricsLogger.action(logMaker);
+ }
+
public void action(Context context, int category, int value) {
MetricsLogger.action(context, category, Integer.toString(value));
}
diff --git a/src/com/android/settings/core/instrumentation/LogWriter.java b/src/com/android/settings/core/instrumentation/LogWriter.java
index 45f1d57..4a2fc6c 100644
--- a/src/com/android/settings/core/instrumentation/LogWriter.java
+++ b/src/com/android/settings/core/instrumentation/LogWriter.java
@@ -40,6 +40,11 @@
/**
* Logs an user action.
*/
+ void actionWithSource(Context context, int source, int category);
+
+ /**
+ * Logs an user action.
+ */
void action(Context context, int category, int value);
/**
diff --git a/src/com/android/settings/core/instrumentation/MetricsFeatureProvider.java b/src/com/android/settings/core/instrumentation/MetricsFeatureProvider.java
index 1a9a451..13a4d7e 100644
--- a/src/com/android/settings/core/instrumentation/MetricsFeatureProvider.java
+++ b/src/com/android/settings/core/instrumentation/MetricsFeatureProvider.java
@@ -15,8 +15,79 @@
*/
package com.android.settings.core.instrumentation;
+import android.content.Context;
+import android.metrics.LogMaker;
+
+import java.util.ArrayList;
+import java.util.List;
+
/**
* FeatureProvider for metrics.
*/
-public interface MetricsFeatureProvider extends LogWriter {
+public class MetricsFeatureProvider {
+ private List<LogWriter> mLoggerWriters;
+
+ public MetricsFeatureProvider() {
+ mLoggerWriters = new ArrayList<>();
+ installLogWriters();
+ }
+
+ protected void installLogWriters() {
+ mLoggerWriters.add(new EventLogWriter());
+ mLoggerWriters.add(new SettingSuggestionsLogWriter());
+ }
+
+ public void visible(Context context, int category) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.visible(context, category);
+ }
+ }
+
+ public void hidden(Context context, int category) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.hidden(context, category);
+ }
+ }
+
+ public void actionWithSource(Context context, int source, int category) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.actionWithSource(context, source, category);
+ }
+ }
+
+ public void action(Context context, int category) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.action(context, category);
+ }
+ }
+
+ public void action(Context context, int category, int value) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.action(context, category, value);
+ }
+ }
+
+ public void action(Context context, int category, boolean value) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.action(context, category, value);
+ }
+ }
+
+ public void action(Context context, int category, String pkg) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.action(context, category, pkg);
+ }
+ }
+
+ public void count(Context context, String name, int value) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.count(context, name, value);
+ }
+ }
+
+ public void histogram(Context context, String name, int bucket) {
+ for (LogWriter writer : mLoggerWriters) {
+ writer.histogram(context, name, bucket);
+ }
+ }
}
diff --git a/src/com/android/settings/core/instrumentation/MetricsFeatureProviderImpl.java b/src/com/android/settings/core/instrumentation/MetricsFeatureProviderImpl.java
deleted file mode 100644
index 091eb54..0000000
--- a/src/com/android/settings/core/instrumentation/MetricsFeatureProviderImpl.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2016 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.core.instrumentation;
-
-import android.content.Context;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Implementation for {@link MetricsFeatureProvider}
- */
-public class MetricsFeatureProviderImpl implements MetricsFeatureProvider {
-
- private List<LogWriter> mLoggerWriters;
-
- public MetricsFeatureProviderImpl() {
- mLoggerWriters = new ArrayList<>();
- installLogWriters();
- }
-
- protected void installLogWriters() {
- mLoggerWriters.add(new EventLogWriter());
- mLoggerWriters.add(new SettingSuggestionsLogWriter());
- }
-
- @Override
- public void visible(Context context, int category) {
- for (LogWriter writer : mLoggerWriters) {
- writer.visible(context, category);
- }
- }
-
- @Override
- public void hidden(Context context, int category) {
- for (LogWriter writer : mLoggerWriters) {
- writer.hidden(context, category);
- }
- }
-
- @Override
- public void action(Context context, int category) {
- for (LogWriter writer : mLoggerWriters) {
- writer.action(context, category);
- }
- }
-
- @Override
- public void action(Context context, int category, int value) {
- for (LogWriter writer : mLoggerWriters) {
- writer.action(context, category, value);
- }
- }
-
- @Override
- public void action(Context context, int category, boolean value) {
- for (LogWriter writer : mLoggerWriters) {
- writer.action(context, category, value);
- }
- }
-
- @Override
- public void action(Context context, int category, String pkg) {
- for (LogWriter writer : mLoggerWriters) {
- writer.action(context, category, pkg);
- }
- }
-
- @Override
- public void count(Context context, String name, int value) {
- for (LogWriter writer : mLoggerWriters) {
- writer.count(context, name, value);
- }
- }
-
- @Override
- public void histogram(Context context, String name, int bucket) {
- for (LogWriter writer : mLoggerWriters) {
- writer.histogram(context, name, bucket);
- }
- }
-}
diff --git a/src/com/android/settings/core/instrumentation/SettingSuggestionsLogWriter.java b/src/com/android/settings/core/instrumentation/SettingSuggestionsLogWriter.java
index 4c277fb..3b94fe7 100644
--- a/src/com/android/settings/core/instrumentation/SettingSuggestionsLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/SettingSuggestionsLogWriter.java
@@ -17,6 +17,8 @@
package com.android.settings.core.instrumentation;
import android.content.Context;
+import android.metrics.LogMaker;
+
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.logging.MetricsLogger;
import com.android.settings.suggestions.EventStore;
@@ -41,6 +43,10 @@
}
@Override
+ public void actionWithSource(Context context, int source, int category) {
+ }
+
+ @Override
public void action(Context context, int category, int value) {
}
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index 223d050..395a8bd 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -181,7 +181,7 @@
@Override
public ProgressiveDisclosureMixin getProgressiveDisclosureMixin(Context context,
DashboardFragment fragment) {
- return new ProgressiveDisclosureMixin(context, this, fragment);
+ return new ProgressiveDisclosureMixin(context, this, mMetricsFeatureProvider, fragment);
}
@Override
diff --git a/src/com/android/settings/dashboard/ProgressiveDisclosureMixin.java b/src/com/android/settings/dashboard/ProgressiveDisclosureMixin.java
index 2907028..77bd253 100644
--- a/src/com/android/settings/dashboard/ProgressiveDisclosureMixin.java
+++ b/src/com/android/settings/dashboard/ProgressiveDisclosureMixin.java
@@ -25,7 +25,10 @@
import android.text.TextUtils;
import android.util.Log;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
+import com.android.settings.core.instrumentation.Instrumentable;
+import com.android.settings.core.instrumentation.MetricsFeatureProvider;
import com.android.settings.core.lifecycle.LifecycleObserver;
import com.android.settings.core.lifecycle.events.OnCreate;
import com.android.settings.core.lifecycle.events.OnSaveInstanceState;
@@ -45,19 +48,23 @@
private final DashboardFeatureProvider mDashboardFeatureProvider;
// Collapsed preference sorted by order.
private final List<Preference> mCollapsedPrefs = new ArrayList<>();
- private /* final */ ExpandPreference mExpandButton;
+ private final MetricsFeatureProvider mMetricsFeatureProvider;
private final PreferenceFragment mFragment;
+ private /* final */ ExpandPreference mExpandButton;
private int mTileLimit = DEFAULT_TILE_LIMIT;
private boolean mUserExpanded;
public ProgressiveDisclosureMixin(Context context,
- DashboardFeatureProvider dashboardFeatureProvider, PreferenceFragment fragment) {
+ DashboardFeatureProvider dashboardFeatureProvider,
+ MetricsFeatureProvider metricsFeatureProvider,
+ PreferenceFragment fragment) {
mContext = context;
mFragment = fragment;
mExpandButton = new ExpandPreference(context);
mExpandButton.setOnPreferenceClickListener(this);
mDashboardFeatureProvider = dashboardFeatureProvider;
+ mMetricsFeatureProvider = metricsFeatureProvider;
}
@Override
@@ -83,6 +90,14 @@
}
mCollapsedPrefs.clear();
mUserExpanded = true;
+ final int metricsCategory;
+ if (mFragment instanceof Instrumentable) {
+ metricsCategory = ((Instrumentable) mFragment).getMetricsCategory();
+ } else {
+ metricsCategory = MetricsProto.MetricsEvent.VIEW_UNKNOWN;
+ }
+ mMetricsFeatureProvider.actionWithSource(mContext, metricsCategory,
+ MetricsProto.MetricsEvent.ACTION_SETTINGS_ADVANCED_BUTTON_EXPAND);
}
}
return false;
diff --git a/src/com/android/settings/fuelgauge/PowerUsageDetail.java b/src/com/android/settings/fuelgauge/PowerUsageDetail.java
index b3f304a..dace4da 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageDetail.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageDetail.java
@@ -829,19 +829,4 @@
}
}
}
-
- public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
- new BaseSearchIndexProvider() {
- @Override
- public List<SearchIndexableResource> getXmlResourcesToIndex(
- Context context, boolean enabled) {
- if (!FeatureFactory.getFactory(context).getDashboardFeatureProvider(context)
- .isEnabled()) {
- return null;
- }
- final SearchIndexableResource sir = new SearchIndexableResource(context);
- sir.xmlResId = R.xml.power_usage_details;
- return Arrays.asList(sir);
- }
- };
}
diff --git a/src/com/android/settings/gestures/DoubleTapPowerPreferenceController.java b/src/com/android/settings/gestures/DoubleTapPowerPreferenceController.java
index 213259b..d38902e 100644
--- a/src/com/android/settings/gestures/DoubleTapPowerPreferenceController.java
+++ b/src/com/android/settings/gestures/DoubleTapPowerPreferenceController.java
@@ -64,14 +64,4 @@
Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED, 0);
return cameraDisabled == 0;
}
-
- @Override
- public ResultPayload getResultPayload() {
- ArrayMap<Integer, Boolean> valueMap = new ArrayMap<>();
- valueMap.put(0, true);
- valueMap.put(1, false);
-
- return new InlineSwitchPayload(Settings.Secure.CAMERA_DOUBLE_TAP_POWER_GESTURE_DISABLED,
- ResultPayload.SettingsSource.SECURE, valueMap);
- }
}
diff --git a/src/com/android/settings/gestures/DoubleTapScreenPreferenceController.java b/src/com/android/settings/gestures/DoubleTapScreenPreferenceController.java
index 02d8dd7..49e8f51 100644
--- a/src/com/android/settings/gestures/DoubleTapScreenPreferenceController.java
+++ b/src/com/android/settings/gestures/DoubleTapScreenPreferenceController.java
@@ -70,14 +70,4 @@
protected boolean isSwitchPrefEnabled() {
return mAmbientConfig.pulseOnDoubleTapEnabled(mUserId);
}
-
- @Override
- public ResultPayload getResultPayload() {
- ArrayMap<Integer, Boolean> valueMap = new ArrayMap<>();
- valueMap.put(1, true);
- valueMap.put(0, false);
-
- return new InlineSwitchPayload(Settings.Secure.DOZE_PULSE_ON_DOUBLE_TAP,
- ResultPayload.SettingsSource.SECURE, valueMap);
- }
}
diff --git a/src/com/android/settings/gestures/DoubleTwistPreferenceController.java b/src/com/android/settings/gestures/DoubleTwistPreferenceController.java
index fea1c9d..c5174fd 100644
--- a/src/com/android/settings/gestures/DoubleTwistPreferenceController.java
+++ b/src/com/android/settings/gestures/DoubleTwistPreferenceController.java
@@ -85,14 +85,4 @@
}
return false;
}
-
- @Override
- public ResultPayload getResultPayload() {
- ArrayMap<Integer, Boolean> valueMap = new ArrayMap<>();
- valueMap.put(1, true);
- valueMap.put(0, false);
-
- return new InlineSwitchPayload(Settings.Secure.CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED,
- ResultPayload.SettingsSource.SECURE, valueMap);
- }
}
diff --git a/src/com/android/settings/gestures/GestureSettings.java b/src/com/android/settings/gestures/GestureSettings.java
index db6925e..df8e37c 100644
--- a/src/com/android/settings/gestures/GestureSettings.java
+++ b/src/com/android/settings/gestures/GestureSettings.java
@@ -143,51 +143,4 @@
mPreferences.add((GesturePreference) preference);
}
}
-
- public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
- new BaseSearchIndexProvider() {
- @Override
- public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
- boolean enabled) {
- ArrayList<SearchIndexableResource> result =
- new ArrayList<SearchIndexableResource>();
-
- SearchIndexableResource sir = new SearchIndexableResource(context);
- sir.xmlResId = R.xml.gesture_settings;
- result.add(sir);
-
- return result;
- }
-
- @Override
- public List<String> getNonIndexableKeys(Context context) {
- ArrayList<String> result = new ArrayList<String>();
-
- List<PreferenceController> preferenceControllers =
- getPreferenceControllers(context);
- for (PreferenceController controller : preferenceControllers) {
- controller.updateNonIndexableKeys(result);
- }
- return result;
- }
-
- @Override
- public List<PreferenceController> getPreferenceControllers(Context context) {
- List<PreferenceController> controllers = new ArrayList<>();
- AmbientDisplayConfiguration ambientConfig
- = new AmbientDisplayConfiguration(context);
-
- controllers.add(new DoubleTapPowerPreferenceController(context,
- null /* lifecycle */));
- controllers.add(new PickupGesturePreferenceController(context,
- null /* lifecycle */, ambientConfig, UserHandle.myUserId()));
- controllers.add(new DoubleTapScreenPreferenceController(context,
- null /* lifecycle */, ambientConfig, UserHandle.myUserId()));
- controllers.add(new SwipeToNotificationPreferenceController(context,
- null /* lifecycle */));
- controllers.add(new DoubleTwistPreferenceController(context,
- null /* lifecycle */));
- return controllers;
- }
- };
}
diff --git a/src/com/android/settings/gestures/PickupGesturePreferenceController.java b/src/com/android/settings/gestures/PickupGesturePreferenceController.java
index f48551e..ce20f15 100644
--- a/src/com/android/settings/gestures/PickupGesturePreferenceController.java
+++ b/src/com/android/settings/gestures/PickupGesturePreferenceController.java
@@ -70,14 +70,4 @@
Settings.Secure.DOZE_PULSE_ON_PICK_UP, enabled ? 1 : 0);
return true;
}
-
- @Override
- public ResultPayload getResultPayload() {
- ArrayMap<Integer, Boolean> valueMap = new ArrayMap<>();
- valueMap.put(1, true);
- valueMap.put(0, false);
-
- return new InlineSwitchPayload(Settings.Secure.DOZE_PULSE_ON_PICK_UP,
- ResultPayload.SettingsSource.SECURE, valueMap);
- }
}
diff --git a/src/com/android/settings/gestures/SwipeToNotificationPreferenceController.java b/src/com/android/settings/gestures/SwipeToNotificationPreferenceController.java
index 67c8e14..22b88fc 100644
--- a/src/com/android/settings/gestures/SwipeToNotificationPreferenceController.java
+++ b/src/com/android/settings/gestures/SwipeToNotificationPreferenceController.java
@@ -63,14 +63,4 @@
Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 0)
== 1;
}
-
- @Override
- public ResultPayload getResultPayload() {
- ArrayMap<Integer, Boolean> valueMap = new ArrayMap<>();
- valueMap.put(1, true);
- valueMap.put(0, false);
-
- return new InlineSwitchPayload(Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED,
- ResultPayload.SettingsSource.SECURE, valueMap);
- }
}
diff --git a/src/com/android/settings/notification/SoundSettings.java b/src/com/android/settings/notification/SoundSettings.java
index c1a2159..c7b0384 100644
--- a/src/com/android/settings/notification/SoundSettings.java
+++ b/src/com/android/settings/notification/SoundSettings.java
@@ -57,7 +57,7 @@
@Override
public void onAttach(Context context) {
super.onAttach(context);
- mProgressiveDisclosureMixin.setTileLimit(5);
+ mProgressiveDisclosureMixin.setTileLimit(6);
}
@Override
diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.java b/src/com/android/settings/overlay/FeatureFactoryImpl.java
index 4c81e30..1b504f4 100644
--- a/src/com/android/settings/overlay/FeatureFactoryImpl.java
+++ b/src/com/android/settings/overlay/FeatureFactoryImpl.java
@@ -28,7 +28,6 @@
import com.android.settings.applications.IPackageManagerWrapperImpl;
import com.android.settings.applications.PackageManagerWrapperImpl;
import com.android.settings.core.instrumentation.MetricsFeatureProvider;
-import com.android.settings.core.instrumentation.MetricsFeatureProviderImpl;
import com.android.settings.dashboard.DashboardFeatureProvider;
import com.android.settings.dashboard.DashboardFeatureProviderImpl;
import com.android.settings.dashboard.SuggestionFeatureProvider;
@@ -70,7 +69,7 @@
@Override
public MetricsFeatureProvider getMetricsFeatureProvider() {
if (mMetricsFeatureProvider == null) {
- mMetricsFeatureProvider = new MetricsFeatureProviderImpl();
+ mMetricsFeatureProvider = new MetricsFeatureProvider();
}
return mMetricsFeatureProvider;
}
diff --git a/src/com/android/settings/wifi/LinkablePreference.java b/src/com/android/settings/wifi/LinkablePreference.java
index 6b1b87d..5bf51ed 100644
--- a/src/com/android/settings/wifi/LinkablePreference.java
+++ b/src/com/android/settings/wifi/LinkablePreference.java
@@ -55,11 +55,15 @@
super.onBindViewHolder(view);
TextView textView = (TextView) view.findViewById(android.R.id.title);
- if (textView == null || mContentTitle == null || mClickListener == null) {
+ if (textView == null) {
+ return;
+ }
+ textView.setSingleLine(false);
+
+ if (mContentTitle == null || mClickListener == null) {
return;
}
- textView.setSingleLine(false);
StringBuilder contentBuilder = new StringBuilder().append(mContentTitle);
if (mContentDescription != null) {
contentBuilder.append("\n\n");
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 118d6eb..c4b90c7 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -179,7 +179,9 @@
super.onViewCreated(view, savedInstanceState);
final Activity activity = getActivity();
if (activity != null) {
- mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
+ if (!isUiRestricted()) {
+ mProgressHeader = (ProgressBar) setPinnedHeaderView(R.layout.wifi_progress_header);
+ }
}
}
@@ -201,6 +203,10 @@
mConfigureWifiSettingsPreference = findPreference(PREF_KEY_CONFIGURE_WIFI_SETTINGS);
mSavedNetworksPreference = findPreference(PREF_KEY_SAVED_NETWORKS);
+ if (isUiRestricted()) {
+ getPreferenceScreen().removePreference(mAdditionalSettingsPreferenceCategory);
+ }
+
Context prefContext = getPrefContext();
mAddPreference = new Preference(prefContext);
mAddPreference.setIcon(R.drawable.ic_menu_add_inset);
@@ -818,11 +824,11 @@
private void setOffMessage() {
if (isUiRestricted()) {
+ removeConnectedAccessPointPreference();
+ mAccessPointsPreferenceCategory.removeAll();
if (!isUiRestrictedByOnlyAdmin()) {
addMessagePreference(R.string.wifi_empty_list_user_restricted);
}
- removeConnectedAccessPointPreference();
- mAccessPointsPreferenceCategory.removeAll();
return;
}
diff --git a/tests/robotests/assets/grandfather_not_implementing_index_provider b/tests/robotests/assets/grandfather_not_implementing_index_provider
index 05cd93b..5e134bf 100644
--- a/tests/robotests/assets/grandfather_not_implementing_index_provider
+++ b/tests/robotests/assets/grandfather_not_implementing_index_provider
@@ -2,4 +2,6 @@
com.android.settings.language.LanguageAndRegionSettings
com.android.settings.notification.ZenModePrioritySettings
com.android.settings.inputmethod.InputAndGestureSettings
-com.android.settings.accounts.AccountDetailDashboardFragment
\ No newline at end of file
+com.android.settings.accounts.AccountDetailDashboardFragment
+com.android.settings.gestures.GestureSettings
+com.android.settings.fuelgauge.PowerUsageDetail
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java b/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java
index 1625e1c..458af5b 100644
--- a/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppHeaderControllerTest.java
@@ -115,8 +115,8 @@
public void bindViews_shouldBindAllData() {
final String testString = "test";
final View appHeader = mLayoutInflater.inflate(R.layout.app_details, null /* root */);
- final TextView label = (TextView) appHeader.findViewById(android.R.id.title);
- final TextView version = (TextView) appHeader.findViewById(android.R.id.summary);
+ final TextView label = (TextView) appHeader.findViewById(R.id.app_detail_title);
+ final TextView version = (TextView) appHeader.findViewById(R.id.app_detail_summary);
mController = new AppHeaderController(mShadowContext, mFragment, appHeader);
mController.setLabel(testString);
diff --git a/tests/robotests/src/com/android/settings/dashboard/ProgressiveDisclosureTest.java b/tests/robotests/src/com/android/settings/dashboard/ProgressiveDisclosureTest.java
index bb00cb8..573b2b5 100644
--- a/tests/robotests/src/com/android/settings/dashboard/ProgressiveDisclosureTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/ProgressiveDisclosureTest.java
@@ -74,7 +74,9 @@
mAppContext = ShadowApplication.getInstance().getApplicationContext();
mFakeFeatureFactory = (FakeFeatureFactory) FeatureFactory.getFactory(mContext);
mMixin = new ProgressiveDisclosureMixin(mAppContext,
- mFakeFeatureFactory.dashboardFeatureProvider, mPreferenceFragment);
+ mFakeFeatureFactory.dashboardFeatureProvider,
+ mFakeFeatureFactory.metricsFeatureProvider,
+ mPreferenceFragment);
ReflectionHelpers.setField(mMixin, "mExpandButton", mExpandButton);
mPreference = new Preference(mAppContext);
mPreference.setKey("test");
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java
index 5f7d8b5..bdb3522 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapPowerPreferenceControllerTest.java
@@ -93,23 +93,4 @@
assertThat(mController.isSwitchPrefEnabled()).isFalse();
}
-
- @Test
- public void testPreferenceController_ProperResultPayloadType() {
- final Context context = ShadowApplication.getInstance().getApplicationContext();
- mController = new DoubleTapPowerPreferenceController(context, null);
- ResultPayload payload = mController.getResultPayload();
- assertThat(payload).isInstanceOf(InlineSwitchPayload.class);
- }
-
- @Test
- public void testPreferenceController_CorrectPayload() {
- final Context context = ShadowApplication.getInstance().getApplicationContext();
- mController = new DoubleTapPowerPreferenceController(context, null);
- InlineSwitchPayload payload = (InlineSwitchPayload) mController.getResultPayload();
- assertThat(payload.settingsUri).isEqualTo("camera_double_tap_power_gesture_disabled");
- assertThat(payload.settingSource).isEqualTo(ResultPayload.SettingsSource.SECURE);
- assertThat(payload.valueMap.get(0)).isEqualTo(true);
- assertThat(payload.valueMap.get(1)).isEqualTo(false);
- }
}
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java
index 2f922d5..adf8b75 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java
@@ -81,19 +81,4 @@
assertThat(mController.isSwitchPrefEnabled()).isFalse();
}
-
- @Test
- public void testPreferenceController_ProperResultPayloadType() {
- ResultPayload payload = mController.getResultPayload();
- assertThat(payload).isInstanceOf(InlineSwitchPayload.class);
- }
-
- @Test
- public void testPreferenceController_CorrectPayload() {
- InlineSwitchPayload payload = (InlineSwitchPayload) mController.getResultPayload();
- assertThat(payload.settingsUri).isEqualTo("doze_pulse_on_double_tap");
- assertThat(payload.settingSource).isEqualTo(ResultPayload.SettingsSource.SECURE);
- assertThat(payload.valueMap.get(1)).isEqualTo(true);
- assertThat(payload.valueMap.get(0)).isEqualTo(false);
- }
}
diff --git a/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java
index ad682b2..9bf6655 100644
--- a/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/DoubleTwistPreferenceControllerTest.java
@@ -113,19 +113,4 @@
assertThat(mController.isSwitchPrefEnabled()).isFalse();
}
-
- @Test
- public void testPreferenceController_ProperResultPayloadType() {
- ResultPayload payload = mController.getResultPayload();
- assertThat(payload).isInstanceOf(InlineSwitchPayload.class);
- }
-
- @Test
- public void testPreferenceController_CorrectPayload() {
- InlineSwitchPayload payload = (InlineSwitchPayload) mController.getResultPayload();
- assertThat(payload.settingsUri).isEqualTo("camera_double_twist_to_flip_enabled");
- assertThat(payload.settingSource).isEqualTo(ResultPayload.SettingsSource.SECURE);
- assertThat(payload.valueMap.get(1)).isEqualTo(true);
- assertThat(payload.valueMap.get(0)).isEqualTo(false);
- }
}
diff --git a/tests/robotests/src/com/android/settings/gestures/PIckupGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/PIckupGesturePreferenceControllerTest.java
index f112b9e..9dce074 100644
--- a/tests/robotests/src/com/android/settings/gestures/PIckupGesturePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/PIckupGesturePreferenceControllerTest.java
@@ -83,19 +83,4 @@
assertThat(mController.isSwitchPrefEnabled()).isFalse();
}
-
- @Test
- public void testPreferenceController_ProperResultPayloadType() {
- ResultPayload payload = mController.getResultPayload();
- assertThat(payload).isInstanceOf(InlineSwitchPayload.class);
- }
-
- @Test
- public void testPreferenceController_CorrectPayload() {
- InlineSwitchPayload payload = (InlineSwitchPayload) mController.getResultPayload();
- assertThat(payload.settingsUri).isEqualTo("doze_pulse_on_pick_up");
- assertThat(payload.settingSource).isEqualTo(ResultPayload.SettingsSource.SECURE);
- assertThat(payload.valueMap.get(1)).isEqualTo(true);
- assertThat(payload.valueMap.get(0)).isEqualTo(false);
- }
}
diff --git a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java
index 49d73ea..e909667 100644
--- a/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/gestures/SwipeToNotificationPreferenceControllerTest.java
@@ -89,19 +89,4 @@
assertThat(mController.isSwitchPrefEnabled()).isFalse();
}
-
- @Test
- public void testPreferenceController_ProperResultPayloadType() {
- ResultPayload payload = mController.getResultPayload();
- assertThat(payload).isInstanceOf(InlineSwitchPayload.class);
- }
-
- @Test
- public void testPreferenceController_CorrectPayload() {
- InlineSwitchPayload payload = (InlineSwitchPayload) mController.getResultPayload();
- assertThat(payload.settingsUri).isEqualTo("system_navigation_keys_enabled");
- assertThat(payload.settingSource).isEqualTo(ResultPayload.SettingsSource.SECURE);
- assertThat(payload.valueMap.get(1)).isEqualTo(true);
- assertThat(payload.valueMap.get(0)).isEqualTo(false);
- }
}
diff --git a/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java b/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java
index a13a24e..f4370fc 100644
--- a/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/search/DatabaseIndexingUtilsTest.java
@@ -73,14 +73,6 @@
}
@Test
- public void testGetPreferenceControllerUriMap_CompatibleClass_ReturnsNotNull() {
- String className = "com.android.settings.gestures.GestureSettings";
-
- Map map = DatabaseIndexingUtils.getPreferenceControllerUriMap(className, mContext);
- assertThat(map).isNotNull();
- }
-
- @Test
public void testGetPreferenceControllerUriMap_CompatibleClass_ReturnsValidMap() {
String className = "com.android.settings.DisplaySettings";
@@ -96,7 +88,7 @@
}
@Test
- public void testGetPayloadFromMap_MatchingKey_ReturnsPayloa() {
+ public void testGetPayloadFromMap_MatchingKey_ReturnsPayload() {
final String key = "key";
PreferenceController prefController = new PreferenceController(mContext) {
@Override