diff --git a/Android.mk b/Android.mk index e385b340514..283575dfc01 100644 --- a/Android.mk +++ b/Android.mk @@ -49,6 +49,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ settings-contextual-card-protos-lite \ contextualcards \ settings-logtags \ + statsdprotolite \ zxing-core-1.7 LOCAL_PROGUARD_FLAG_FILES := proguard.flags diff --git a/color-check-baseline.xml b/color-check-baseline.xml index e9f8d58aec7..70744814dc2 100644 --- a/color-check-baseline.xml +++ b/color-check-baseline.xml @@ -29,54 +29,6 @@ column="9"/> - - - - - - - - - - - - - - - - + errorLine1=" <color name="crypt_keeper_clock_background">#ff9a9a9a</color>" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" <color name="crypt_keeper_clock_foreground">#ff666666</color>" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + + + + + errorLine1=" <color name="crypt_keeper_password_background">#70606060</color>" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" <color name="divider_color">#20ffffff</color>" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - - - - - - - - - - - - - - - - @@ -345,7 +233,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -361,7 +249,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -377,7 +265,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -393,7 +281,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -409,7 +297,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -425,7 +313,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -441,7 +329,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -457,7 +345,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -473,7 +361,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -489,7 +377,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -505,7 +393,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -521,7 +409,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -537,7 +425,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -553,7 +441,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -569,7 +457,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -585,7 +473,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -597,11 +485,11 @@ priority="4" summary="Using hardcoded color" explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes. This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app." - errorLine1=" <color name="switch_bar_background">#ff80868B</color>" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" <color name="switch_bar_background">#757575</color>" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -617,7 +505,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -633,7 +521,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -649,7 +537,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -665,7 +553,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -681,7 +569,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -697,7 +585,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -713,7 +601,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -729,7 +617,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -745,7 +633,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -761,7 +649,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -777,7 +665,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -793,7 +681,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -809,7 +697,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -825,7 +713,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -841,7 +729,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -857,7 +745,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -873,7 +761,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -889,7 +777,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -905,7 +793,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -921,7 +809,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -937,7 +825,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -953,7 +841,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -969,7 +857,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -985,7 +873,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1001,7 +889,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1017,7 +905,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1033,7 +921,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1049,7 +937,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1065,7 +953,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1081,7 +969,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1097,7 +985,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1113,7 +1001,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1129,7 +1017,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1145,7 +1033,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1161,7 +1049,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1177,7 +1065,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1193,7 +1081,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1209,7 +1097,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1225,7 +1113,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1241,7 +1129,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1257,7 +1145,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1273,7 +1161,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1289,7 +1177,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1305,7 +1193,55 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + + + + + + + + + + + + @@ -1321,7 +1257,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1337,7 +1273,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1353,7 +1289,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1369,7 +1305,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -1653,12 +1589,12 @@ priority="4" summary="Using hardcoded color" explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes. This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app." - errorLine1=" android:color="@color/homepage_about_background" />" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + errorLine1=" android:color="@color/homepage_about_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_accessibility_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_accessibility_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_accounts_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_app_and_notification_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_battery_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_connected_device_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_display_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> - - - - + errorLine1=" android:color="@color/homepage_location_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_network_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_privacy_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_security_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_sound_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_storage_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_support_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_support_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + line="24" + column="13"/> + errorLine1=" android:color="@color/homepage_system_background" />" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + + + + + + + + + + + + + + + + + + + + + + + + @@ -2437,12 +2453,12 @@ priority="4" summary="Using hardcoded color" explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes. This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app." - errorLine1=" <string name="sync_plug" msgid="3905078969081888738">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‎‏‏‎‎‎‏‏‎‎‎‏‏‎‏‎‎‎‎‎‏‎‏‎‎‎‎‏‏‏‏‎‎‎‏‏‏‏‏‏‏‎‎‏‎‏‏‏‏‏‏‏‏‏‏‎‎‎‏‎‎‎‏‎‎‏‏‎"<font fgcolor="#ffffffff">"‎‏‎‎‏‏‏‎Welcome to Google sync!‎‏‎‎‏‏‎"</font>"‎‏‎‎‏‏‏‎ ‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎A Google approach to syncing data to allow access to your contacts, appointments, and more from wherever you are.‎‏‎‎‏‎"</string>" - errorLine2=" ~~~~~~~~~~~~~~~~~~~"> + errorLine1=" <string name="sync_plug" msgid="3905078969081888738">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‎‏‏‎‎‎‏‏‎‎‎‏‏‎‏‎‎‎‎‎‏‎‏‎‎‎‎‏‏‏‏‎‎‎‏‏‏‏‏‏‏‎‎‏‎‏‏‏‏‏‏‏‏‏‏‎‎‎‏‎‎‎‏‎‎‏‏‎"<font fgcolor="#ffffffff">"‎‏‎‎‏‏‏‎Welcome to Google sync!‎‏‎‎‏‏‎"</font>"‎‏‎‎‏‏‏‎ ‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎A Google approach to syncing data to allow access to your contacts, appointments, and more from wherever you are.‎‏‎‎‏‎"</string>" + errorLine2=" ~~~~~~~~~~~~~~~~~~~"> + line="2580" + column="169"/> @@ -2473,7 +2489,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -2489,7 +2505,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -2505,7 +2521,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -2521,7 +2537,7 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~"> @@ -2537,7 +2553,7 @@ errorLine2=" ^"> @@ -2553,7 +2569,7 @@ errorLine2=" ^"> @@ -2569,7 +2585,7 @@ errorLine2=" ^"> @@ -2585,7 +2601,7 @@ errorLine2=" ^"> @@ -2601,7 +2617,7 @@ errorLine2=" ^"> @@ -2729,7 +2745,7 @@ errorLine2=" ^"> @@ -2745,7 +2761,7 @@ errorLine2=" ^"> @@ -2761,7 +2777,7 @@ errorLine2=" ^"> @@ -2777,7 +2793,7 @@ errorLine2=" ^"> @@ -2793,7 +2809,7 @@ errorLine2=" ^"> @@ -2809,7 +2825,7 @@ errorLine2=" ^"> @@ -2825,7 +2841,7 @@ errorLine2=" ^"> diff --git a/res/layout/homepage_condition_footer.xml b/res/layout/homepage_condition_footer.xml index cc84f524a26..56687fe4b04 100644 --- a/res/layout/homepage_condition_footer.xml +++ b/res/layout/homepage_condition_footer.xml @@ -29,7 +29,6 @@ android:id="@+id/collapse_button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/ic_expand_less" - android:tint="?android:attr/colorAccent"/> + android:src="@drawable/ic_expand_less"/> \ No newline at end of file diff --git a/res/layout/homepage_condition_header.xml b/res/layout/homepage_condition_header.xml index 5c1b1812c4a..5460be95adc 100644 --- a/res/layout/homepage_condition_header.xml +++ b/res/layout/homepage_condition_header.xml @@ -45,8 +45,8 @@ android:paddingTop="@dimen/homepage_condition_header_indicator_padding_top" android:paddingStart="@dimen/homepage_condition_header_indicator_padding_start" android:paddingEnd="@dimen/homepage_condition_header_indicator_padding_end" - android:src="@*android:drawable/ic_expand_more" - android:tint="?android:attr/colorAccent"/> + android:src="@drawable/ic_expand_more_inverse" + android:tint="?android:attr/colorControlNormal"/> diff --git a/res/layout/homepage_slice_tile.xml b/res/layout/homepage_slice_tile.xml index e95129e6041..b2badf5ba51 100644 --- a/res/layout/homepage_slice_tile.xml +++ b/res/layout/homepage_slice_tile.xml @@ -32,6 +32,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:animateLayoutChanges="true" + android:importantForAccessibility="no" style="@style/SliceViewStyle"/> diff --git a/res/layout/master_clear.xml b/res/layout/master_clear.xml index 9c1dd80ed05..63685881af0 100644 --- a/res/layout/master_clear.xml +++ b/res/layout/master_clear.xml @@ -127,12 +127,9 @@ android:text="@string/erase_external_storage_description"/> - + + + diff --git a/res/layout/reset_esim_checkbox.xml b/res/layout/reset_esim_checkbox.xml index 21954359959..77b90a182c2 100644 --- a/res/layout/reset_esim_checkbox.xml +++ b/res/layout/reset_esim_checkbox.xml @@ -15,7 +15,9 @@ --> + android:layout_height="wrap_content" + android:text="@string/reset_esim_title"/> - + diff --git a/res/layout/settings_homepage_container.xml b/res/layout/settings_homepage_container.xml index 78a0278462c..9332463ea79 100644 --- a/res/layout/settings_homepage_container.xml +++ b/res/layout/settings_homepage_container.xml @@ -25,6 +25,7 @@ android:id="@+id/main_content_scrollable_container" android:layout_width="match_parent" android:layout_height="match_parent" + android:importantForAccessibility="no" app:layout_behavior="com.android.settings.widget.FloatingAppBarScrollingViewBehavior"> Reset Wi-Fi, mobile & Bluetooth This will reset all network settings, including:\n\n
  • Wi\u2011Fi
  • \n
  • Mobile data
  • \n
  • Bluetooth
  • "
    - - Also reset eSIM + + Erase eSIMs - Erase all eSIMs on the phone. You\u2019ll have to contact your carrier to redownload your eSIMs. This will not cancel your mobile service plan. + You\u2019ll have to contact your carrier to download replacement eSIMs. This won\u2019t cancel any mobile service plans. Reset settings @@ -3633,12 +3633,6 @@ Erase all the data on the internal USB storage, such as music or photos Erase all the data on the SD card, such as music or photos - - Erase eSIM - - Erase all eSIMs on the phone. This will not cancel your mobile service plan. - - Erase all eSIMs on the tablet. This will not cancel your mobile service plan. Erase all data @@ -9892,8 +9886,6 @@ Wake up display - - To check time, notifications, and other info, pick up your phone. diff --git a/res/xml/security_lockscreen_settings.xml b/res/xml/security_lockscreen_settings.xml index 6833922e964..611d33fee57 100644 --- a/res/xml/security_lockscreen_settings.xml +++ b/res/xml/security_lockscreen_settings.xml @@ -59,12 +59,6 @@ android:summary="@string/doze_always_on_summary" settings:controller="com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController" /> - - + settings:controller="com.android.settings.applications.specialaccess.zenaccess.ZenAccessController" /> - - - - - - - - - \ No newline at end of file diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java index 58bc58c475b..c78115d13c5 100644 --- a/src/com/android/settings/MasterClear.java +++ b/src/com/android/settings/MasterClear.java @@ -326,8 +326,6 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL if (showWipeEuicc()) { if (showWipeEuiccCheckbox()) { - TextView title = mContentView.findViewById(R.id.erase_esim_title); - title.setText(R.string.erase_esim_storage); mEsimStorageContainer.setVisibility(View.VISIBLE); mEsimStorageContainer.setOnClickListener(new View.OnClickListener() { @Override diff --git a/src/com/android/settings/ResetNetwork.java b/src/com/android/settings/ResetNetwork.java index bd45f9bd3c3..5d7dd9994c6 100644 --- a/src/com/android/settings/ResetNetwork.java +++ b/src/com/android/settings/ResetNetwork.java @@ -213,8 +213,6 @@ public class ResetNetwork extends InstrumentedFragment { mInitiateButton.setOnClickListener(mInitiateListener); if (showEuiccSettings(getContext())) { mEsimContainer.setVisibility(View.VISIBLE); - TextView title = mContentView.findViewById(R.id.erase_esim_title); - title.setText(R.string.reset_esim_title); mEsimContainer.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { diff --git a/src/com/android/settings/UserCredentialsSettings.java b/src/com/android/settings/UserCredentialsSettings.java index c30e51df668..d322819ba98 100644 --- a/src/com/android/settings/UserCredentialsSettings.java +++ b/src/com/android/settings/UserCredentialsSettings.java @@ -154,11 +154,15 @@ public class UserCredentialsSettings extends SettingsPreferenceFragment dialog.dismiss(); } }; - if (item.isSystem()) { - // TODO: a safe means of clearing wifi certificates. Configs refer to aliases - // directly so deleting certs will break dependent access points. - builder.setNegativeButton(R.string.trusted_credentials_remove_label, listener); - } + // TODO: b/127865361 + // a safe means of clearing wifi certificates. Configs refer to aliases + // directly so deleting certs will break dependent access points. + // However, Wi-Fi used to remove this certificate from storage if the network + // was removed, regardless if it is used in more than one network. + // It has been decided to allow removing certificates from this menu, as we + // assume that the user who manually adds certificates must have a way to + // manually remove them. + builder.setNegativeButton(R.string.trusted_credentials_remove_label, listener); } return builder.create(); } @@ -172,7 +176,8 @@ public class UserCredentialsSettings extends SettingsPreferenceFragment * Deletes all certificates and keys under a given alias. * * If the {@link Credential} is for a system alias, all active grants to the alias will be - * removed using {@link KeyChain}. + * removed using {@link KeyChain}. If the {@link Credential} is for Wi-Fi alias, all + * credentials and keys will be removed using {@link KeyStore}. */ private class RemoveCredentialsTask extends AsyncTask { private Context context; @@ -188,14 +193,32 @@ public class UserCredentialsSettings extends SettingsPreferenceFragment for (final Credential credential : credentials) { if (credential.isSystem()) { removeGrantsAndDelete(credential); - continue; + } else { + deleteWifiCredential(credential); } - throw new UnsupportedOperationException( - "Not implemented for wifi certificates. This should not be reachable."); } return credentials; } + private void deleteWifiCredential(final Credential credential) { + final KeyStore keyStore = KeyStore.getInstance(); + final EnumSet storedTypes = credential.getStoredTypes(); + + // Remove all Wi-Fi credentials + if (storedTypes.contains(Credential.Type.USER_KEY)) { + keyStore.delete(Credentials.USER_PRIVATE_KEY + credential.getAlias(), + Process.WIFI_UID); + } + if (storedTypes.contains(Credential.Type.USER_CERTIFICATE)) { + keyStore.delete(Credentials.USER_CERTIFICATE + credential.getAlias(), + Process.WIFI_UID); + } + if (storedTypes.contains(Credential.Type.CA_CERTIFICATE)) { + keyStore.delete(Credentials.CA_CERTIFICATE + credential.getAlias(), + Process.WIFI_UID); + } + } + private void removeGrantsAndDelete(final Credential credential) { final KeyChainConnection conn; try { @@ -488,5 +511,11 @@ public class UserCredentialsSettings extends SettingsPreferenceFragment public boolean isSystem() { return UserHandle.getAppId(uid) == Process.SYSTEM_UID; } + + public String getAlias() { return alias; } + + public EnumSet getStoredTypes() { + return storedTypes; + } } } diff --git a/src/com/android/settings/applications/RecentAppsPreferenceController.java b/src/com/android/settings/applications/RecentAppsPreferenceController.java index c0d18c6eb81..be86dd5b63f 100644 --- a/src/com/android/settings/applications/RecentAppsPreferenceController.java +++ b/src/com/android/settings/applications/RecentAppsPreferenceController.java @@ -25,6 +25,7 @@ import android.app.usage.UsageStatsManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; +import android.icu.text.RelativeDateTimeFormatter; import android.os.PowerManager; import android.os.UserHandle; import android.util.ArrayMap; @@ -224,7 +225,8 @@ public class RecentAppsPreferenceController extends BasePreferenceController .setIcon(mIconDrawableFactory.getBadgedIcon(appEntry.info)) .setTitle(appEntry.label) .setSummary(StringUtil.formatRelativeTime(mContext, - System.currentTimeMillis() - stat.getLastTimeUsed(), false)) + System.currentTimeMillis() - stat.getLastTimeUsed(), false, + RelativeDateTimeFormatter.Style.SHORT)) .setOnClickListener(v -> AppInfoBase.startAppInfoFragment(AppInfoDashboardFragment.class, R.string.application_info_label, pkgName, appEntry.info.uid, diff --git a/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java b/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java index d0b26a53328..0f90c69c9ae 100644 --- a/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java +++ b/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java @@ -15,22 +15,13 @@ */ package com.android.settings.applications.appinfo; -import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; - -import android.app.ActivityManager; import android.app.AppOpsManager; import android.app.settings.SettingsEnums; import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; import android.os.Bundle; -import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.view.Window; -import android.view.WindowManager; import androidx.annotation.VisibleForTesting; import androidx.appcompat.app.AlertDialog; @@ -55,16 +46,11 @@ public class DrawOverlayDetails extends AppInfoWithHeader implements OnPreferenc private static final String KEY_APP_OPS_SETTINGS_SWITCH = "app_ops_settings_switch"; private static final String LOG_TAG = "DrawOverlayDetails"; - private static final int[] APP_OPS_OP_CODE = { - AppOpsManager.OP_SYSTEM_ALERT_WINDOW - }; - // Use a bridge to get the overlay details but don't initialize it to connect with all state. // TODO: Break out this functionality into its own class. private AppStateOverlayBridge mOverlayBridge; private AppOpsManager mAppOpsManager; private SwitchPreference mSwitchPref; - private Intent mSettingsIntent; private OverlayState mOverlayState; @Override @@ -82,18 +68,15 @@ public class DrawOverlayDetails extends AppInfoWithHeader implements OnPreferenc // find preferences addPreferencesFromResource(R.xml.draw_overlay_permissions_details); - mSwitchPref = (SwitchPreference) findPreference(KEY_APP_OPS_SETTINGS_SWITCH); + mSwitchPref = findPreference(KEY_APP_OPS_SETTINGS_SWITCH); // install event listeners mSwitchPref.setOnPreferenceChangeListener(this); - - mSettingsIntent = new Intent(Intent.ACTION_MAIN) - .setAction(Settings.ACTION_MANAGE_OVERLAY_PERMISSION); } // Override here so we don't have an empty screen @Override - public View onCreateView (LayoutInflater inflater, + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // if we don't have a package info, show a page saying this is unsupported @@ -103,21 +86,6 @@ public class DrawOverlayDetails extends AppInfoWithHeader implements OnPreferenc return super.onCreateView(inflater, container, savedInstanceState); } - @Override - public void onResume() { - super.onResume(); - getActivity().getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); - } - - @Override - public void onPause() { - super.onPause(); - Window window = getActivity().getWindow(); - WindowManager.LayoutParams attrs = window.getAttributes(); - attrs.privateFlags &= ~SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; - window.setAttributes(attrs); - } - @Override public void onDestroy() { super.onDestroy(); @@ -164,7 +132,9 @@ public class DrawOverlayDetails extends AppInfoWithHeader implements OnPreferenc @Override protected boolean refreshUi() { - if (mPackageInfo == null) return true; + if (mPackageInfo == null) { + return true; + } mOverlayState = mOverlayBridge.getOverlayInfo(mPackageName, mPackageInfo.applicationInfo.uid); @@ -174,9 +144,6 @@ public class DrawOverlayDetails extends AppInfoWithHeader implements OnPreferenc // you cannot ask a user to grant you a permission you did not have! mSwitchPref.setEnabled(mOverlayState.permissionDeclared && mOverlayState.controlEnabled); - ResolveInfo resolveInfo = mPm.resolveActivityAsUser(mSettingsIntent, - PackageManager.GET_META_DATA, mUserId); - return true; } diff --git a/src/com/android/settings/applications/specialaccess/zenaccess/OWNERS b/src/com/android/settings/applications/specialaccess/zenaccess/OWNERS new file mode 100644 index 00000000000..9b5f41ef32c --- /dev/null +++ b/src/com/android/settings/applications/specialaccess/zenaccess/OWNERS @@ -0,0 +1,2 @@ +beverlyt@google.com +juliacr@google.com \ No newline at end of file diff --git a/src/com/android/settings/applications/specialaccess/ZenAccessController.java b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java similarity index 95% rename from src/com/android/settings/applications/specialaccess/ZenAccessController.java rename to src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java index 5ae2bd3c903..88d444d485c 100644 --- a/src/com/android/settings/applications/specialaccess/ZenAccessController.java +++ b/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessController.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.settings.applications.specialaccess; +package com.android.settings.applications.specialaccess.zenaccess; import android.app.ActivityManager; import android.content.Context; diff --git a/src/com/android/settings/core/HideNonSystemOverlayMixin.java b/src/com/android/settings/core/HideNonSystemOverlayMixin.java new file mode 100644 index 00000000000..59cef3bea17 --- /dev/null +++ b/src/com/android/settings/core/HideNonSystemOverlayMixin.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2019 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; + +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + +import static androidx.lifecycle.Lifecycle.Event.ON_START; +import static androidx.lifecycle.Lifecycle.Event.ON_STOP; + +import android.app.Activity; +import android.view.Window; +import android.view.WindowManager; + +import androidx.lifecycle.LifecycleObserver; +import androidx.lifecycle.OnLifecycleEvent; + + +/** + * A mixin that adds window flag to prevent non-system overlays showing on top of Settings + * activities. + */ +public class HideNonSystemOverlayMixin implements LifecycleObserver { + + private final Activity mActivity; + + public HideNonSystemOverlayMixin(Activity activity) { + mActivity = activity; + } + + @OnLifecycleEvent(ON_START) + public void onStart() { + if (mActivity == null) { + return; + } + mActivity.getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); + android.util.EventLog.writeEvent(0x534e4554, "120484087", -1, ""); + } + + + @OnLifecycleEvent(ON_STOP) + public void onStop() { + if (mActivity == null) { + return; + } + final Window window = mActivity.getWindow(); + final WindowManager.LayoutParams attrs = window.getAttributes(); + attrs.privateFlags &= ~SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + window.setAttributes(attrs); + } +} diff --git a/src/com/android/settings/core/SettingsBaseActivity.java b/src/com/android/settings/core/SettingsBaseActivity.java index 294e7542d90..cd1365404c8 100644 --- a/src/com/android/settings/core/SettingsBaseActivity.java +++ b/src/com/android/settings/core/SettingsBaseActivity.java @@ -32,7 +32,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; -import android.view.WindowManager.LayoutParams; import android.widget.Toolbar; import androidx.fragment.app.FragmentActivity; @@ -59,8 +58,8 @@ public class SettingsBaseActivity extends FragmentActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - final long startTime = System.currentTimeMillis(); + getLifecycle().addObserver(new HideNonSystemOverlayMixin(this)); final TypedArray theme = getTheme().obtainStyledAttributes(android.R.styleable.Theme); if (!theme.getBoolean(android.R.styleable.Theme_windowNoTitle, false)) { diff --git a/src/com/android/settings/gestures/SystemNavigationPreferenceController.java b/src/com/android/settings/gestures/SystemNavigationPreferenceController.java index a11754efe18..e1be9d43f89 100644 --- a/src/com/android/settings/gestures/SystemNavigationPreferenceController.java +++ b/src/com/android/settings/gestures/SystemNavigationPreferenceController.java @@ -51,13 +51,15 @@ public abstract class SystemNavigationPreferenceController extends GesturePrefer private static final String ENABLE_ASSISTANT_GESTURE = "ENABLE_ASSISTANT_GESTURE"; private static final String PROTOTYPE_ENABLED = "prototype_enabled"; - private static final int EDGE_SENSITIVITY_WIDTH = 32; + private static final int EDGE_SENSITIVITY_WIDTH = 48; private static final String EDGE_SENSITIVITY_KEY = "quickstepcontroller_edge_width_sensitivity"; private static final String GESTURES_MATCH_MAP_OFF = "000000"; private static final String GESTURES_MATCH_MAP_ON = "071133"; private static final String GESTURES_MATCH_MAP_KEY = "quickstepcontroller_gesture_match_map"; + private static final String OVERLAY_NAVBAR_KEY = + "com.android.internal.experiment.navbar.default"; private static final String OVERLAY_NAVBAR_TYPE_INSET = "com.android.internal.experiment.navbar.type.inset"; private static final String OVERLAY_NAVBAR_TYPE_FLOATING = @@ -174,6 +176,7 @@ public abstract class SystemNavigationPreferenceController extends GesturePrefer .asInterface(ServiceManager.getService(Context.OVERLAY_SERVICE)); if (overlayManager != null) { try { + overlayManager.setEnabled(OVERLAY_NAVBAR_KEY, true, USER_SYSTEM); overlayManager.setEnabled(OVERLAY_NAVBAR_TYPE_FLOATING, false, USER_SYSTEM); overlayManager.setEnabled(OVERLAY_NAVBAR_TYPE_INSET, enable, USER_SYSTEM); } catch (RemoteException e) { diff --git a/src/com/android/settings/gestures/WakeScreenGestureSettings.java b/src/com/android/settings/gestures/WakeScreenGestureSettings.java deleted file mode 100644 index b8a782ac95a..00000000000 --- a/src/com/android/settings/gestures/WakeScreenGestureSettings.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -package com.android.settings.gestures; - -import android.app.settings.SettingsEnums; -import android.content.Context; -import android.provider.SearchIndexableResource; - -import com.android.settings.R; -import com.android.settings.dashboard.DashboardFragment; -import com.android.settings.search.BaseSearchIndexProvider; -import com.android.settingslib.search.SearchIndexable; - -import java.util.Arrays; -import java.util.List; - -@SearchIndexable -public class WakeScreenGestureSettings extends DashboardFragment { - - private static final String TAG = "WakeScreenGestureSettings"; - - public static final String PREF_KEY_SUGGESTION_COMPLETE = - "pref_wake_screen_gesture_suggestion_complete"; - - @Override - public int getMetricsCategory() { - return SettingsEnums.SETTINGS_GESTURE_WAKE_SCREEN; - } - - @Override - protected String getLogTag() { - return TAG; - } - - @Override - protected int getPreferenceScreenResId() { - return R.xml.wake_screen_gesture_settings; - } - - public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = - new BaseSearchIndexProvider() { - @Override - public List getXmlResourcesToIndex( - Context context, boolean enabled) { - final SearchIndexableResource sir = new SearchIndexableResource(context); - sir.xmlResId = R.xml.wake_screen_gesture_settings; - return Arrays.asList(sir); - } - }; - -} diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java b/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java index 43e90e8cf28..ce7777a5e5b 100644 --- a/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java +++ b/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java @@ -139,7 +139,7 @@ public class ContextualCardFeatureProviderImpl implements ContextualCardFeatureP final String action = mContext.getString(R.string.config_settingsintelligence_log_action); if (!TextUtils.isEmpty(action)) { intent.setAction(action); - mContext.sendBroadcastAsUser(intent, UserHandle.ALL); + mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT); } } diff --git a/src/com/android/settings/media/MediaOutputSlice.java b/src/com/android/settings/media/MediaOutputSlice.java index 232986c45e0..e76bc88ae39 100644 --- a/src/com/android/settings/media/MediaOutputSlice.java +++ b/src/com/android/settings/media/MediaOutputSlice.java @@ -76,6 +76,11 @@ public class MediaOutputSlice implements CustomSliceable { return null; } + if (getWorker() == null) { + Log.d(TAG, "getSlice() Can not get worker through uri!"); + return null; + } + final List devices = getMediaDevices(); @ColorInt final int color = Utils.getColorAccentDefaultColor(mContext); @@ -115,13 +120,15 @@ public class MediaOutputSlice implements CustomSliceable { private MediaDeviceUpdateWorker getWorker() { if (mWorker == null) { mWorker = (MediaDeviceUpdateWorker) SliceBackgroundWorker.getInstance(getUri()); - mWorker.setPackageName(mPackageName); + if (mWorker != null) { + mWorker.setPackageName(mPackageName); + } } return mWorker; } private List getMediaDevices() { - List devices = getWorker().getMediaDevices(); + final List devices = getWorker().getMediaDevices(); return devices; } diff --git a/src/com/android/settings/network/telephony/NetworkSelectSettings.java b/src/com/android/settings/network/telephony/NetworkSelectSettings.java index d70bd62b4c3..47db8756998 100644 --- a/src/com/android/settings/network/telephony/NetworkSelectSettings.java +++ b/src/com/android/settings/network/telephony/NetworkSelectSettings.java @@ -27,7 +27,7 @@ import android.telephony.AccessNetworkConstants; import android.telephony.CarrierConfigManager; import android.telephony.CellIdentity; import android.telephony.CellInfo; -import android.telephony.NetworkRegistrationState; +import android.telephony.NetworkRegistrationInfo; import android.telephony.ServiceState; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; @@ -304,7 +304,7 @@ public class NetworkSelectSettings extends DashboardFragment { * Config the connected network operator preference when the page was created. When user get * into this page, the device might or might not have data connection. * - If the device has data: - * 1. use {@code ServiceState#getNetworkRegistrationStates()} to get the currently + * 1. use {@code ServiceState#getNetworkRegistrationInfoList()} to get the currently * registered cellIdentity, wrap it into a CellInfo; * 2. set the signal strength level as strong; * 3. use {@link TelephonyManager#getNetworkOperatorName()} to get the title of the @@ -317,8 +317,8 @@ public class NetworkSelectSettings extends DashboardFragment { if (mTelephonyManager.getDataState() == mTelephonyManager.DATA_CONNECTED) { // Try to get the network registration states ServiceState ss = mTelephonyManager.getServiceState(); - List networkList = - ss.getNetworkRegistrationStatesForTransportType( + List networkList = + ss.getNetworkRegistrationInfoListForTransportType( AccessNetworkConstants.TRANSPORT_TYPE_WWAN); if (networkList == null || networkList.size() == 0) { // Remove the connected network operators category diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java index 5fd26a64c95..3ccca000406 100644 --- a/src/com/android/settings/notification/AppNotificationSettings.java +++ b/src/com/android/settings/notification/AppNotificationSettings.java @@ -16,8 +16,6 @@ package com.android.settings.notification; -import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; - import android.app.NotificationChannel; import android.app.NotificationChannelGroup; import android.app.settings.SettingsEnums; @@ -26,8 +24,6 @@ import android.os.AsyncTask; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; -import android.view.Window; -import android.view.WindowManager; import androidx.preference.Preference; import androidx.preference.PreferenceCategory; @@ -88,8 +84,6 @@ public class AppNotificationSettings extends NotificationSettingsBase { public void onResume() { super.onResume(); - getActivity().getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); - if (mUid < 0 || TextUtils.isEmpty(mPkg) || mPkgInfo == null) { Log.w(TAG, "Missing package or uid or packageinfo"); finish(); @@ -123,15 +117,6 @@ public class AppNotificationSettings extends NotificationSettingsBase { updatePreferenceStates(); } - @Override - public void onPause() { - super.onPause(); - final Window window = getActivity().getWindow(); - final WindowManager.LayoutParams attrs = window.getAttributes(); - attrs.privateFlags &= ~SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; - window.setAttributes(attrs); - } - @Override protected String getLogTag() { return TAG; diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java index ec1e835755c..d3d5c499fe7 100644 --- a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java +++ b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java @@ -198,7 +198,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity { } else if (isManagedProfile && isInternalActivity() && !lockPatternUtils.isSeparateProfileChallengeEnabled(mUserId)) { mCredentialMode = CREDENTIAL_MANAGED; - if (isBiometricAllowed(effectiveUserId)) { + if (isBiometricAllowed(effectiveUserId, mUserId)) { showBiometricPrompt(bpBundle); launchedBiometric = true; } else { @@ -207,7 +207,7 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity { } } else { mCredentialMode = CREDENTIAL_NORMAL; - if (isBiometricAllowed(effectiveUserId)) { + if (isBiometricAllowed(effectiveUserId, mUserId)) { // Don't need to check if biometrics / pin/pattern/pass are enrolled. It will go to // onAuthenticationError and do the right thing automatically. showBiometricPrompt(bpBundle); @@ -273,9 +273,10 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity { return (disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_BIOMETRICS) != 0; } - private boolean isBiometricAllowed(int effectiveUserId) { + private boolean isBiometricAllowed(int effectiveUserId, int realUserId) { return !isStrongAuthRequired(effectiveUserId) - && !isBiometricDisabledByAdmin(effectiveUserId); + && !isBiometricDisabledByAdmin(effectiveUserId) + && !mLockPatternUtils.hasPendingEscrowToken(realUserId); } private void showBiometricPrompt(Bundle bundle) { @@ -304,9 +305,18 @@ public class ConfirmDeviceCredentialActivity extends FragmentActivity { private void showConfirmCredentials() { mCCLaunched = true; boolean launched = false; + // The only difference between CREDENTIAL_MANAGED and CREDENTIAL_NORMAL is that for + // CREDENTIAL_MANAGED, we launch the real confirm credential activity with an explicit + // but dummy challenge value (0L). This will result in ConfirmLockPassword calling + // verifyTiedProfileChallenge() (if it's a profile with unified challenge), due to the + // difference between ConfirmLockPassword.startVerifyPassword() and + // ConfirmLockPassword.startCheckPassword(). Calling verifyTiedProfileChallenge() here is + // necessary when this is part of the turning on work profile flow, because it forces + // unlocking the work profile even before the profile is running. + // TODO: Remove the duplication of checkPassword and verifyPassword in ConfirmLockPassword, + // LockPatternChecker and LockPatternUtils. verifyPassword should be the only API to use, + // which optionally accepts a challenge. if (mCredentialMode == CREDENTIAL_MANAGED) { - // We set the challenge as 0L, so it will force to unlock managed profile when it - // unlocks primary profile screen lock, by calling verifyTiedProfileChallenge() launched = mChooseLockSettingsHelper .launchConfirmationActivityWithExternalAndChallenge( 0 /* request code */, null /* title */, mTitle, mDetails, diff --git a/src/com/android/settings/search/SearchFeatureProvider.java b/src/com/android/settings/search/SearchFeatureProvider.java index dcb4acc5d92..896f6e5c78c 100644 --- a/src/com/android/settings/search/SearchFeatureProvider.java +++ b/src/com/android/settings/search/SearchFeatureProvider.java @@ -39,7 +39,7 @@ import com.android.settingslib.search.SearchIndexableResources; */ public interface SearchFeatureProvider { - int REQUEST_CODE = 0; + int REQUEST_CODE = 501; /** * Ensures the caller has necessary privilege to launch search result page. diff --git a/src/com/android/settings/search/actionbar/SearchMenuController.java b/src/com/android/settings/search/actionbar/SearchMenuController.java index af7141e54f1..25d0d3027d5 100644 --- a/src/com/android/settings/search/actionbar/SearchMenuController.java +++ b/src/com/android/settings/search/actionbar/SearchMenuController.java @@ -33,6 +33,7 @@ import com.android.settings.Utils; import com.android.settings.core.InstrumentedFragment; import com.android.settings.core.InstrumentedPreferenceFragment; import com.android.settings.overlay.FeatureFactory; +import com.android.settings.search.SearchFeatureProvider; import com.android.settingslib.core.lifecycle.LifecycleObserver; import com.android.settingslib.core.lifecycle.events.OnCreateOptionsMenu; @@ -93,7 +94,7 @@ public class SearchMenuController implements LifecycleObserver, OnCreateOptionsM FeatureFactory.getFactory(context).getMetricsFeatureProvider() .action(context, SettingsEnums.ACTION_SEARCH_RESULTS); - mHost.startActivityForResult(intent, 0 /* requestCode */); + mHost.startActivityForResult(intent, SearchFeatureProvider.REQUEST_CODE); return true; }); } diff --git a/src/com/android/settings/slices/SliceBackgroundWorker.java b/src/com/android/settings/slices/SliceBackgroundWorker.java index 559aa711e2a..f19b1df79d3 100644 --- a/src/com/android/settings/slices/SliceBackgroundWorker.java +++ b/src/com/android/settings/slices/SliceBackgroundWorker.java @@ -146,7 +146,7 @@ public abstract class SliceBackgroundWorker implements Closeable { needNotify = true; } } else { - needNotify = !results.equals(mCachedResults); + needNotify = !areListsTheSame(results, mCachedResults); } if (needNotify) { @@ -155,6 +155,10 @@ public abstract class SliceBackgroundWorker implements Closeable { } } + protected boolean areListsTheSame(List a, List b) { + return a.equals(b); + } + /** * Notify that data was updated and attempt to sync changes to the Slice. */ diff --git a/src/com/android/settings/slices/SlicesIndexer.java b/src/com/android/settings/slices/SlicesIndexer.java index 1b3a25ef876..5f800471ba3 100644 --- a/src/com/android/settings/slices/SlicesIndexer.java +++ b/src/com/android/settings/slices/SlicesIndexer.java @@ -84,7 +84,6 @@ class SlicesIndexer implements Runnable { } finally { database.endTransaction(); } - database.close(); } @VisibleForTesting diff --git a/src/com/android/settings/wifi/slice/WifiSlice.java b/src/com/android/settings/wifi/slice/WifiSlice.java index a2debb8873f..1c44204daf1 100644 --- a/src/com/android/settings/wifi/slice/WifiSlice.java +++ b/src/com/android/settings/wifi/slice/WifiSlice.java @@ -32,6 +32,7 @@ import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.net.NetworkInfo; +import android.net.NetworkInfo.State; import android.net.Uri; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; @@ -355,7 +356,6 @@ public class WifiSlice implements CustomSliceable { @Override public void onConnectedChanged() { - notifySliceChange(); } @Override @@ -370,10 +370,43 @@ public class WifiSlice implements CustomSliceable { final List resultList = new ArrayList<>(); for (AccessPoint ap : accessPoints) { if (ap.isReachable()) { - resultList.add(ap); + resultList.add(clone(ap)); + if (resultList.size() >= DEFAULT_EXPANDED_ROW_COUNT) { + break; + } } } updateResults(resultList); } + + private AccessPoint clone(AccessPoint accessPoint) { + final Bundle savedState = new Bundle(); + accessPoint.saveWifiState(savedState); + return new AccessPoint(mContext, savedState); + } + + @Override + protected boolean areListsTheSame(List a, List b) { + if (!a.equals(b)) { + return false; + } + + // compare access point states one by one + final int listSize = a.size(); + for (int i = 0; i < listSize; i++) { + if (getState(a.get(i)) != getState(b.get(i))) { + return false; + } + } + return true; + } + + private State getState(AccessPoint accessPoint) { + final NetworkInfo networkInfo = accessPoint.getNetworkInfo(); + if (networkInfo != null) { + return networkInfo.getState(); + } + return null; + } } } diff --git a/tests/robotests/src/com/android/settings/applications/specialaccess/ZenAccessControllerTest.java b/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessControllerTest.java similarity index 96% rename from tests/robotests/src/com/android/settings/applications/specialaccess/ZenAccessControllerTest.java rename to tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessControllerTest.java index 5bce86c386c..bcb4bb3bf4a 100644 --- a/tests/robotests/src/com/android/settings/applications/specialaccess/ZenAccessControllerTest.java +++ b/tests/robotests/src/com/android/settings/applications/specialaccess/zenaccess/ZenAccessControllerTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.settings.applications.specialaccess; +package com.android.settings.applications.specialaccess.zenaccess; import static com.google.common.truth.Truth.assertThat; diff --git a/tests/robotests/src/com/android/settings/core/HideNonSystemOverlayMixinTest.java b/tests/robotests/src/com/android/settings/core/HideNonSystemOverlayMixinTest.java new file mode 100644 index 00000000000..579cba09c14 --- /dev/null +++ b/tests/robotests/src/com/android/settings/core/HideNonSystemOverlayMixinTest.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2019 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; + +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + +import static com.google.common.truth.Truth.assertThat; + +import android.os.Bundle; +import android.view.WindowManager; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + +import com.android.settings.R; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.Robolectric; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.RuntimeEnvironment; +import org.robolectric.android.controller.ActivityController; + +@RunWith(RobolectricTestRunner.class) +public class HideNonSystemOverlayMixinTest { + + private ActivityController mActivityController; + + @Before + public void setUp() { + RuntimeEnvironment.application.setTheme(R.style.Theme_AppCompat); + mActivityController = Robolectric.buildActivity(TestActivity.class); + } + + @Test + public void startActivity_shouldHideNonSystemOverlay() { + mActivityController.setup(); + TestActivity activity = mActivityController.get(); + + // Activity start: HIDE_NON_SYSTEM_OVERLAY should be set. + final WindowManager.LayoutParams attrs = activity.getWindow().getAttributes(); + assertThat(attrs.privateFlags & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) + .isNotEqualTo(0); + } + + @Test + public void stopActivity_shouldUnhideNonSystemOverlay() { + mActivityController.setup().stop(); + TestActivity activity = mActivityController.get(); + + final WindowManager.LayoutParams attrs = activity.getWindow().getAttributes(); + assertThat(attrs.privateFlags & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) + .isEqualTo(0); + } + + public static class TestActivity extends AppCompatActivity { + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + getLifecycle().addObserver(new HideNonSystemOverlayMixin(this)); + } + } +} diff --git a/tests/robotests/src/com/android/settings/gestures/WakeScreenGestureSettingsTest.java b/tests/robotests/src/com/android/settings/gestures/WakeScreenGestureSettingsTest.java deleted file mode 100644 index f1d2fcc12d0..00000000000 --- a/tests/robotests/src/com/android/settings/gestures/WakeScreenGestureSettingsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -package com.android.settings.gestures; - -import static com.google.common.truth.Truth.assertThat; - -import android.provider.SearchIndexableResource; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.RuntimeEnvironment; - -import java.util.List; - -@RunWith(RobolectricTestRunner.class) -public class WakeScreenGestureSettingsTest { - - private WakeScreenGestureSettings mSettings; - - @Before - public void setUp() { - mSettings = new WakeScreenGestureSettings(); - } - - @Test - public void testSearchIndexProvider_shouldIndexResource() { - final List indexRes = - WakeScreenGestureSettings.SEARCH_INDEX_DATA_PROVIDER.getXmlResourcesToIndex( - RuntimeEnvironment.application, true /* enabled */); - - assertThat(indexRes).isNotNull(); - assertThat(indexRes.get(0).xmlResId).isEqualTo(mSettings.getPreferenceScreenResId()); - } -} diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImplTest.java index 2db7f3fcb21..0683bd88bef 100644 --- a/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImplTest.java +++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImplTest.java @@ -57,7 +57,7 @@ public class ContextualCardFeatureProviderImplTest { final Intent intent = new Intent(); mImpl.sendBroadcast(intent); - verify(mContext, never()).sendBroadcastAsUser(intent, UserHandle.ALL); + verify(mContext, never()).sendBroadcastAsUser(intent, UserHandle.CURRENT); } @Test @@ -66,7 +66,7 @@ public class ContextualCardFeatureProviderImplTest { final Intent intent = new Intent(); mImpl.sendBroadcast(intent); - verify(mContext).sendBroadcastAsUser(intent, UserHandle.ALL); + verify(mContext).sendBroadcastAsUser(intent, UserHandle.CURRENT); } @Test diff --git a/tests/robotests/src/com/android/settings/media/MediaOutputSliceTest.java b/tests/robotests/src/com/android/settings/media/MediaOutputSliceTest.java index da0d85b5472..d26a458011a 100644 --- a/tests/robotests/src/com/android/settings/media/MediaOutputSliceTest.java +++ b/tests/robotests/src/com/android/settings/media/MediaOutputSliceTest.java @@ -93,6 +93,13 @@ public class MediaOutputSliceTest { mMediaOutputSlice.init(TEST_PACKAGE_NAME, mMediaDeviceUpdateWorker); } + @Test + public void getSlice_workerIsNull_shouldNotCrash() { + mMediaOutputSlice.init(TEST_PACKAGE_NAME, null); + + mMediaOutputSlice.getSlice(); + } + @Test public void getSlice_shouldHaveActiveDeviceName() { mDevices.clear(); diff --git a/tests/robotests/src/com/android/settings/notification/RemoteVolumePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/RemoteVolumePreferenceControllerTest.java index 1bf2fd81bb6..1e68de59684 100644 --- a/tests/robotests/src/com/android/settings/notification/RemoteVolumePreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/notification/RemoteVolumePreferenceControllerTest.java @@ -23,7 +23,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.content.Context; -import android.media.session.ControllerLink; +import android.media.session.ISessionController; import android.media.session.MediaController; import android.media.session.MediaSession; import android.media.session.MediaSessionManager; @@ -51,9 +51,9 @@ public class RemoteVolumePreferenceControllerTest { @Mock private MediaController mMediaController; @Mock - private ControllerLink.ControllerStub mStub; + private ISessionController mStub; @Mock - private ControllerLink.ControllerStub mStub2; + private ISessionController mStub2; private MediaSession.Token mToken; private MediaSession.Token mToken2; private RemoteVolumePreferenceController mController; @@ -71,8 +71,8 @@ public class RemoteVolumePreferenceControllerTest { mActiveSessions.add(mMediaController); when(mMediaSessionManager.getActiveSessions(null)).thenReturn( mActiveSessions); - mToken = new MediaSession.Token(new ControllerLink(mStub)); - mToken2 = new MediaSession.Token(new ControllerLink(mStub2)); + mToken = new MediaSession.Token(mStub); + mToken2 = new MediaSession.Token(mStub2); mController = new RemoteVolumePreferenceController(mContext); mPlaybackInfo = new MediaController.PlaybackInfo( diff --git a/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java b/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java index 01feb8ecaed..75a9e117739 100644 --- a/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java +++ b/tests/robotests/src/com/android/settings/wifi/slice/WifiSliceTest.java @@ -34,8 +34,10 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.net.NetworkInfo; +import android.net.NetworkInfo.State; import android.net.Uri; import android.net.wifi.WifiManager; +import android.os.Bundle; import androidx.core.graphics.drawable.IconCompat; import androidx.slice.Slice; @@ -61,6 +63,7 @@ import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; @RunWith(RobolectricTestRunner.class) @@ -253,11 +256,42 @@ public class WifiSliceTest { verify(mResolver).notifyChange(WIFI_SLICE_URI, null); } - @Test - public void onConnectedChanged_shouldNotifyChange() { - mWifiScanWorker.onConnectedChanged(); + private AccessPoint createAccessPoint(String name, State state) { + final NetworkInfo info = mock(NetworkInfo.class); + doReturn(state).when(info).getState(); - verify(mResolver).notifyChange(WIFI_SLICE_URI, null); + final Bundle savedState = new Bundle(); + savedState.putString("key_ssid", name); + savedState.putParcelable("key_networkinfo", info); + return new AccessPoint(mContext, savedState); + } + + @Test + public void SliceAccessPoint_sameState_shouldBeTheSame() { + final AccessPoint ap1 = createAccessPoint(AP1_NAME, State.CONNECTED); + final AccessPoint ap2 = createAccessPoint(AP1_NAME, State.CONNECTED); + + assertThat(mWifiScanWorker.areListsTheSame(Arrays.asList(ap1), Arrays.asList(ap2))) + .isTrue(); + } + + @Test + public void SliceAccessPoint_differentState_shouldBeDifferent() { + final AccessPoint ap1 = createAccessPoint(AP1_NAME, State.CONNECTING); + final AccessPoint ap2 = createAccessPoint(AP1_NAME, State.CONNECTED); + + assertThat(mWifiScanWorker.areListsTheSame(Arrays.asList(ap1), Arrays.asList(ap2))) + .isFalse(); + } + @Test + public void SliceAccessPoint_differentLength_shouldBeDifferent() { + final AccessPoint ap1 = createAccessPoint(AP1_NAME, State.CONNECTED); + final AccessPoint ap2 = createAccessPoint(AP1_NAME, State.CONNECTED); + final List list = new ArrayList<>(); + list.add(ap1); + list.add(ap2); + + assertThat(mWifiScanWorker.areListsTheSame(list, Arrays.asList(ap1))).isFalse(); } @Implements(SliceBackgroundWorker.class)