Merge "Fix SetupSkipDialogTest" into tm-dev
diff --git a/res/layout/accessibility_shortcut_secondary_action.xml b/res/layout/accessibility_shortcut_secondary_action.xml
index 8d0ef3b..bdb129f 100644
--- a/res/layout/accessibility_shortcut_secondary_action.xml
+++ b/res/layout/accessibility_shortcut_secondary_action.xml
@@ -21,17 +21,15 @@
     android:layout_height="wrap_content"
     android:minHeight="?android:attr/listPreferredItemHeightSmall"
     android:gravity="center_vertical"
-    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
-    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
     android:clipToPadding="false">
 
     <LinearLayout
         android:id="@+id/main_frame"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
         android:layout_weight="1"
-        android:gravity="start|center_vertical"
-        >
+        android:gravity="start|center_vertical">
 
         <FrameLayout
             android:id="@+id/icon_frame"
@@ -91,6 +89,7 @@
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:gravity="end|center_vertical"
+        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
         android:minWidth="58dp"
         android:orientation="vertical" />
 
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 03fc59f..ef6a3c7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5293,7 +5293,7 @@
     <!-- Message for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
     <string name="accessibility_text_reading_preview_mail_from">From: Bill</string>
     <!-- Content for the mail content of the accessibility text reading preview. [CHAR LIMIT=NONE] -->
-    <string name="accessibility_text_reading_preview_mail_content">Good morning! Following up on our last conversation, I\u2019d like to check in on the progress of your time machine development plan. Will you be able to have a prototype ready to demo at E3 this year?</string>
+    <string name="accessibility_text_reading_preview_mail_content">Good morning!\n\nI just wanted to check how the designs are coming. Will they be ready before we start building the new balloons?</string>
     <!-- Title for the reset button of the accessibility text reading page to reset all preferences state. [CHAR LIMIT=25] -->
     <string name="accessibility_text_reading_reset_button_title">Reset settings</string>
     <!-- Title for the confirm dialog of reset settings. [CHAR LIMIT=NONE] -->
@@ -14090,11 +14090,11 @@
     <!-- The title of the spatial audio [CHAR LIMIT=none] -->
     <string name="bluetooth_details_spatial_audio_title">Spatial audio</string>
     <!-- The summary of the spatial audio [CHAR LIMIT=none] -->
-    <string name="bluetooth_details_spatial_audio_summary">Immersive audio seems like it\u0027s coming from all around you. Only works with some media.</string>
+    <string name="bluetooth_details_spatial_audio_summary">Audio from compatible media becomes more immersive</string>
     <!-- The title of the head tracking [CHAR LIMIT=none] -->
-    <string name="bluetooth_details_head_tracking_title">Make audio more realistic</string>
+    <string name="bluetooth_details_head_tracking_title">Head tracking</string>
     <!-- The summary of the head tracking [CHAR LIMIT=none] -->
-    <string name="bluetooth_details_head_tracking_summary">Shift positioning of audio so it sounds more natural.</string>
+    <string name="bluetooth_details_head_tracking_summary">Audio changes as you move your head to sound more natural</string>
 
     <!-- Developer Settings: Title for network bandwidth ingress rate limit [CHAR LIMIT=none] -->
     <string name="ingress_rate_limit_title">Network download rate limit</string>
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index 1176fa4..d2d6a33 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -27,6 +27,7 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.pm.PackageManager;
 import android.icu.text.CaseMap;
 import android.net.Uri;
 import android.os.Bundle;
@@ -162,9 +163,14 @@
 
     @Override
     protected void initSettingsPreference() {
-        // If the device doesn't support magnification area, it should hide the settings preference.
-        if (!getContext().getResources().getBoolean(
-                com.android.internal.R.bool.config_magnification_area)) {
+        // If the device doesn't support window magnification feature, it should hide the
+        // settings preference.
+        final boolean supportWindowMagnification =
+                getContext().getResources().getBoolean(
+                        com.android.internal.R.bool.config_magnification_area)
+                        && getContext().getPackageManager().hasSystemFeature(
+                        PackageManager.FEATURE_WINDOW_MAGNIFICATION);
+        if (!supportWindowMagnification) {
             return;
         }
         mSettingsPreference = new Preference(getPrefContext());
diff --git a/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java
index 8500e61..00ff960 100644
--- a/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentTest.java
@@ -36,6 +36,7 @@
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.pm.PackageManager;
 import android.content.res.Resources;
 import android.os.Bundle;
 import android.provider.Settings;
@@ -101,6 +102,8 @@
     private FragmentActivity mActivity;
     @Mock
     private ContentResolver mContentResolver;
+    @Mock
+    private PackageManager mPackageManager;
 
     @Before
     public void setUpTestFragment() {
@@ -110,6 +113,7 @@
         mFragment = spy(new TestToggleScreenMagnificationPreferenceFragment(mContext));
         mResources = spy(mContext.getResources());
         when(mContext.getResources()).thenReturn(mResources);
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
         when(mFragment.getContext().getResources()).thenReturn(mResources);
         when(mFragment.getActivity()).thenReturn(mActivity);
         when(mActivity.getContentResolver()).thenReturn(mContentResolver);
@@ -334,10 +338,26 @@
 
     @Ignore("Ignore it since a NPE is happened in ShadowWindowManagerGlobal. (Ref. b/214161063)")
     @Test
-    public void onCreateView_notSupportsMagnificationArea_settingsPreferenceIsNull() {
+    public void onCreateView_magnificationAreaNotSupported_settingsPreferenceIsNull() {
         when(mResources.getBoolean(
                 com.android.internal.R.bool.config_magnification_area))
                 .thenReturn(false);
+        when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_WINDOW_MAGNIFICATION))
+                .thenReturn(true);
+
+        mFragment.onCreateView(LayoutInflater.from(mContext), mock(ViewGroup.class), Bundle.EMPTY);
+
+        assertThat(mFragment.mSettingsPreference).isNull();
+    }
+
+    @Ignore("Ignore it since a NPE is happened in ShadowWindowManagerGlobal. (Ref. b/214161063)")
+    @Test
+    public void onCreateView_windowMagnificationNotSupported_settingsPreferenceIsNull() {
+        when(mResources.getBoolean(
+                com.android.internal.R.bool.config_magnification_area))
+                .thenReturn(true);
+        when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_WINDOW_MAGNIFICATION))
+                .thenReturn(false);
 
         mFragment.onCreateView(LayoutInflater.from(mContext), mock(ViewGroup.class), Bundle.EMPTY);
 
diff --git a/tests/unit/src/com/android/settings/deviceinfo/PrivateVolumeForgetTest.java b/tests/unit/src/com/android/settings/deviceinfo/PrivateVolumeForgetTest.java
index 1edfa93..957e0c8 100644
--- a/tests/unit/src/com/android/settings/deviceinfo/PrivateVolumeForgetTest.java
+++ b/tests/unit/src/com/android/settings/deviceinfo/PrivateVolumeForgetTest.java
@@ -28,6 +28,7 @@
 
 import com.android.settings.Settings;
 
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -40,6 +41,7 @@
             new ActivityTestRule<>(Settings.PrivateVolumeForgetActivity.class, true, true);
 
     @Test
+    @Ignore
     public void test_invalidSetupDoesNotCrashSettings() {
         Context targetContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
         Intent intent = new Intent(targetContext, Settings.PrivateVolumeForgetActivity.class);