diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 762d84d..4117b2e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -866,6 +866,7 @@
         <activity
             android:name=".localepicker.AppLocalePickerActivity"
             android:label="@string/app_locale_picker_title"
+            android:configChanges="orientation|screenSize|keyboardHidden"
             android:exported="true" >
             <intent-filter>
                 <action android:name="android.settings.APP_LOCALE_SETTINGS" />
@@ -1451,7 +1452,8 @@
         <activity
             android:name=".datausage.AppDataUsageActivity"
             android:exported="true"
-            android:noHistory="true">
+            android:noHistory="true"
+            android:permission="android.permission.QUERY_ALL_PACKAGES">
             <intent-filter android:priority="1">
                 <action android:name="android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -1521,6 +1523,7 @@
         <activity-alias android:name=".applications.InstalledAppDetails"
                 android:label="@string/application_info_label"
                 android:exported="true"
+                android:permission="android.permission.QUERY_ALL_PACKAGES"
                 android:targetActivity=".applications.InstalledAppDetailsTop">
             <intent-filter android:priority="1">
                 <action android:name="android.settings.APPLICATION_DETAILS_SETTINGS" />
@@ -1534,7 +1537,8 @@
 
         <activity android:name=".applications.InstalledAppOpenByDefaultActivity"
                   android:label="@string/application_info_label"
-                  android:exported="true">
+                  android:exported="true"
+                  android:permission="android.permission.QUERY_ALL_PACKAGES">
             <intent-filter android:priority="1">
                 <action android:name="android.settings.APP_OPEN_BY_DEFAULT_SETTINGS" />
                 <!-- Also catch legacy "com." prefixed action. -->
@@ -1905,7 +1909,8 @@
         <activity
             android:name="Settings$AppUsageAccessSettingsActivity"
             android:exported="true"
-            android:label="@string/usage_access_title">
+            android:label="@string/usage_access_title"
+            android:permission="android.permission.QUERY_ALL_PACKAGES">
             <intent-filter>
                 <action android:name="android.settings.USAGE_ACCESS_SETTINGS"/>
                 <category android:name="android.intent.category.DEFAULT"/>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index c80e42c..f11cee5 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -452,6 +452,7 @@
 
     <!-- Text padding for EmptyTextSettings -->
     <dimen name="empty_text_padding">24dp</dimen>
+    <dimen name="empty_text_layout_height">450dp</dimen>
 
     <!--  Choose SIM Activity dimens  -->
     <dimen name="subtitle_bottom_padding">24dp</dimen>
diff --git a/res/xml/accessibility_settings.xml b/res/xml/accessibility_settings.xml
index 509aed6..0287fc6 100644
--- a/res/xml/accessibility_settings.xml
+++ b/res/xml/accessibility_settings.xml
@@ -41,7 +41,8 @@
             android:icon="@drawable/ic_adaptive_font_download"
             android:key="text_reading_options"
             android:persistent="false"
-            android:title="@string/accessibility_text_reading_options_title" />
+            android:title="@string/accessibility_text_reading_options_title"
+            settings:controller="com.android.settings.accessibility.TextReadingFragmentForA11ySettingsController"/>
 
         <Preference
             android:fragment="com.android.settings.accessibility.ColorAndMotionFragment"
diff --git a/res/xml/accessibility_settings_for_setup_wizard.xml b/res/xml/accessibility_settings_for_setup_wizard.xml
index a50e7dd..6929d54 100644
--- a/res/xml/accessibility_settings_for_setup_wizard.xml
+++ b/res/xml/accessibility_settings_for_setup_wizard.xml
@@ -26,7 +26,8 @@
         android:key="text_reading_options"
         android:persistent="false"
         android:title="@string/accessibility_text_reading_options_title"
-        settings:keywords="text_reading_options" />
+        settings:keywords="text_reading_options"
+        settings:controller="com.android.settings.accessibility.TextReadingFragmentForSuwController"/>
 
     <Preference
         android:fragment="com.android.settings.accessibility.ToggleScreenMagnificationPreferenceFragmentForSetupWizard"
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml
index 03d073b..2336c15 100644
--- a/res/xml/display_settings.xml
+++ b/res/xml/display_settings.xml
@@ -72,7 +72,8 @@
             android:fragment="com.android.settings.accessibility.TextReadingPreferenceFragment"
             android:key="text_reading_options"
             android:persistent="false"
-            android:title="@string/accessibility_text_reading_options_title" />
+            android:title="@string/accessibility_text_reading_options_title"
+            settings:controller="com.android.settings.accessibility.TextReadingFragmentForDisplaySettingsController"/>
     </PreferenceCategory>
 
     <PreferenceCategory
diff --git a/src/com/android/settings/accessibility/AccessibilityStatsLogUtils.java b/src/com/android/settings/accessibility/AccessibilityStatsLogUtils.java
index 434157d..d8a887d 100644
--- a/src/com/android/settings/accessibility/AccessibilityStatsLogUtils.java
+++ b/src/com/android/settings/accessibility/AccessibilityStatsLogUtils.java
@@ -16,6 +16,16 @@
 
 package com.android.settings.accessibility;
 
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.BOLD_TEXT_KEY;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.DISPLAY_SIZE_KEY;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.ACCESSIBILITY_SETTINGS;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.DISPLAY_SETTINGS;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.SUW_ANYTHING_ELSE;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.SUW_VISION_SETTINGS;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.FONT_SIZE_KEY;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.HIGH_TEXT_CONTRAST_KEY;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.RESET_KEY;
+
 import android.content.ComponentName;
 
 import com.android.settings.core.instrumentation.SettingsStatsLog;
@@ -58,4 +68,48 @@
                                 .ACCESSIBILITY_PRIVACY_WARNING_STATUS_SERVICE_DISABLED,
                         durationMills);
     }
+
+    /**
+     * Converts to the key name for logging.
+     *
+     * @param prefKey the preference key
+     * @return the int value which maps to the key name
+     */
+    static int convertToItemKeyName(String prefKey) {
+        switch (prefKey) {
+            case FONT_SIZE_KEY:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__NAME__TEXT_READING_FONT_SIZE;
+            case DISPLAY_SIZE_KEY:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__NAME__TEXT_READING_DISPLAY_SIZE;
+            case BOLD_TEXT_KEY:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__NAME__TEXT_READING_BOLD_TEXT;
+            case HIGH_TEXT_CONTRAST_KEY:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__NAME__TEXT_READING_HIGH_CONTRAST_TEXT;
+            case RESET_KEY:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__NAME__TEXT_READING_RESET;
+            default:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__NAME__TEXT_READING_UNKNOWN_ITEM;
+        }
+    }
+
+    /**
+     * Converts to the entry point for logging.
+     *
+     * @param entryPoint the entry point
+     * @return the int value which maps to the entry point
+     */
+    static int convertToEntryPoint(int entryPoint) {
+        switch (entryPoint) {
+            case SUW_VISION_SETTINGS:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__ENTRY_POINT__TEXT_READING_SUW_VISION_SETTINGS;
+            case SUW_ANYTHING_ELSE:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__ENTRY_POINT__TEXT_READING_SUW_ANYTHING_ELSE;
+            case DISPLAY_SETTINGS:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__ENTRY_POINT__TEXT_READING_DISPLAY_SETTINGS;
+            case ACCESSIBILITY_SETTINGS:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__ENTRY_POINT__TEXT_READING_ACCESSIBILITY_SETTINGS;
+            default:
+                return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__ENTRY_POINT__TEXT_READING_UNKNOWN_ENTRY;
+        }
+    }
 }
diff --git a/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceController.java b/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceController.java
index e3c1b9e..923e880 100644
--- a/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceController.java
+++ b/src/com/android/settings/accessibility/FontWeightAdjustmentPreferenceController.java
@@ -21,7 +21,9 @@
 import android.provider.Settings;
 
 import com.android.settings.R;
+import com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint;
 import com.android.settings.core.TogglePreferenceController;
+import com.android.settings.core.instrumentation.SettingsStatsLog;
 
 /** PreferenceController for displaying all text in bold. */
 public class FontWeightAdjustmentPreferenceController extends TogglePreferenceController implements
@@ -29,6 +31,9 @@
     static final int BOLD_TEXT_ADJUSTMENT =
             FontStyle.FONT_WEIGHT_BOLD - FontStyle.FONT_WEIGHT_NORMAL;
 
+    @EntryPoint
+    private int mEntryPoint;
+
     public FontWeightAdjustmentPreferenceController(Context context, String preferenceKey) {
         super(context, preferenceKey);
     }
@@ -46,6 +51,12 @@
 
     @Override
     public boolean setChecked(boolean isChecked) {
+        SettingsStatsLog.write(
+                SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED,
+                AccessibilityStatsLogUtils.convertToItemKeyName(getPreferenceKey()),
+                isChecked ? 1 : 0,
+                AccessibilityStatsLogUtils.convertToEntryPoint(mEntryPoint));
+
         return Settings.Secure.putInt(mContext.getContentResolver(),
                 Settings.Secure.FONT_WEIGHT_ADJUSTMENT, (isChecked ? BOLD_TEXT_ADJUSTMENT : 0));
     }
@@ -59,4 +70,13 @@
     public void resetState() {
         setChecked(false);
     }
+
+    /**
+     * The entry point is used for logging.
+     *
+     * @param entryPoint from which settings page
+     */
+    void setEntryPoint(@EntryPoint int entryPoint) {
+        mEntryPoint = entryPoint;
+    }
 }
diff --git a/src/com/android/settings/accessibility/HighTextContrastPreferenceController.java b/src/com/android/settings/accessibility/HighTextContrastPreferenceController.java
index 8c9d234..9f645f1 100644
--- a/src/com/android/settings/accessibility/HighTextContrastPreferenceController.java
+++ b/src/com/android/settings/accessibility/HighTextContrastPreferenceController.java
@@ -23,7 +23,9 @@
 import androidx.preference.SwitchPreference;
 
 import com.android.settings.R;
+import com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint;
 import com.android.settings.core.TogglePreferenceController;
+import com.android.settings.core.instrumentation.SettingsStatsLog;
 
 /**
  * PreferenceController for displaying all text in high contrast style.
@@ -32,6 +34,9 @@
         TextReadingResetController.ResetStateListener {
     private SwitchPreference mSwitchPreference;
 
+    @EntryPoint
+    private int mEntryPoint;
+
     public HighTextContrastPreferenceController(Context context, String preferenceKey) {
         super(context, preferenceKey);
     }
@@ -49,6 +54,12 @@
 
     @Override
     public boolean setChecked(boolean isChecked) {
+        SettingsStatsLog.write(
+                SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED,
+                AccessibilityStatsLogUtils.convertToItemKeyName(getPreferenceKey()),
+                isChecked ? 1 : 0,
+                AccessibilityStatsLogUtils.convertToEntryPoint(mEntryPoint));
+
         return Settings.Secure.putInt(mContext.getContentResolver(),
                 Settings.Secure.ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, (isChecked ? 1 : 0));
     }
@@ -69,4 +80,13 @@
         setChecked(false);
         updateState(mSwitchPreference);
     }
+
+    /**
+     * The entry point is used for logging.
+     *
+     * @param entryPoint from which settings page
+     */
+    void setEntryPoint(@EntryPoint int entryPoint) {
+        mEntryPoint = entryPoint;
+    }
 }
diff --git a/src/com/android/settings/accessibility/PreviewSizeSeekBarController.java b/src/com/android/settings/accessibility/PreviewSizeSeekBarController.java
index c7dfd61..711eb0f 100644
--- a/src/com/android/settings/accessibility/PreviewSizeSeekBarController.java
+++ b/src/com/android/settings/accessibility/PreviewSizeSeekBarController.java
@@ -22,7 +22,9 @@
 import androidx.annotation.NonNull;
 import androidx.preference.PreferenceScreen;
 
+import com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint;
 import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.instrumentation.SettingsStatsLog;
 import com.android.settings.widget.LabeledSeekBarPreference;
 
 /**
@@ -36,6 +38,9 @@
     private ProgressInteractionListener mInteractionListener;
     private LabeledSeekBarPreference mSeekBarPreference;
 
+    @EntryPoint
+    private int mEntryPoint;
+
     private final SeekBar.OnSeekBarChangeListener mSeekBarChangeListener =
             new SeekBar.OnSeekBarChangeListener() {
                 @Override
@@ -45,6 +50,12 @@
                     if (!mSeekByTouch && mInteractionListener != null) {
                         mInteractionListener.onProgressChanged();
                     }
+
+                    SettingsStatsLog.write(
+                            SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED,
+                            AccessibilityStatsLogUtils.convertToItemKeyName(getPreferenceKey()),
+                            progress,
+                            AccessibilityStatsLogUtils.convertToEntryPoint(mEntryPoint));
                 }
 
                 @Override
@@ -97,6 +108,15 @@
     }
 
     /**
+     * The entry point is used for logging.
+     *
+     * @param entryPoint from which settings page
+     */
+    void setEntryPoint(@EntryPoint int entryPoint) {
+        mEntryPoint = entryPoint;
+    }
+
+    /**
      * Interface for callbacks when users interact with the seek bar.
      */
     interface ProgressInteractionListener {
diff --git a/src/com/android/settings/accessibility/TextReadingFragmentBaseController.java b/src/com/android/settings/accessibility/TextReadingFragmentBaseController.java
new file mode 100644
index 0000000..f26ca96
--- /dev/null
+++ b/src/com/android/settings/accessibility/TextReadingFragmentBaseController.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2022 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.accessibility;
+
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EXTRA_LAUNCHED_FROM;
+
+import android.content.Context;
+import android.os.Bundle;
+
+import androidx.preference.Preference;
+
+import com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint;
+import com.android.settings.core.BasePreferenceController;
+
+/**
+ * The base controller for the fragment{@link TextReadingPreferenceFragment}.
+ */
+public class TextReadingFragmentBaseController extends BasePreferenceController {
+    @EntryPoint
+    private int mEntryPoint;
+
+    private TextReadingFragmentBaseController(Context context, String preferenceKey) {
+        super(context, preferenceKey);
+    }
+
+    TextReadingFragmentBaseController(Context context, String preferenceKey,
+            @EntryPoint int entryPoint) {
+        this(context, preferenceKey);
+        mEntryPoint = entryPoint;
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return AVAILABLE;
+    }
+
+    @Override
+    public boolean handlePreferenceTreeClick(Preference preference) {
+        if (getPreferenceKey().equals(preference.getKey())) {
+            final Bundle extras = preference.getExtras();
+            extras.putInt(EXTRA_LAUNCHED_FROM, mEntryPoint);
+        }
+
+        return super.handlePreferenceTreeClick(preference);
+    }
+}
diff --git a/src/com/android/settings/accessibility/TextReadingFragmentForA11ySettingsController.java b/src/com/android/settings/accessibility/TextReadingFragmentForA11ySettingsController.java
new file mode 100644
index 0000000..434877c
--- /dev/null
+++ b/src/com/android/settings/accessibility/TextReadingFragmentForA11ySettingsController.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 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.accessibility;
+
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.ACCESSIBILITY_SETTINGS;
+
+import android.content.Context;
+
+/**
+ * The controller for the {@link TextReadingPreferenceFragment} from the accessibility settings.
+ */
+public class TextReadingFragmentForA11ySettingsController extends
+        TextReadingFragmentBaseController {
+    public TextReadingFragmentForA11ySettingsController(Context context, String preferenceKey) {
+        // Pass the fixed entry point to the parent controller for logging.
+        super(context, preferenceKey, ACCESSIBILITY_SETTINGS);
+    }
+}
diff --git a/src/com/android/settings/accessibility/TextReadingFragmentForDisplaySettingsController.java b/src/com/android/settings/accessibility/TextReadingFragmentForDisplaySettingsController.java
new file mode 100644
index 0000000..4d603f9
--- /dev/null
+++ b/src/com/android/settings/accessibility/TextReadingFragmentForDisplaySettingsController.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2022 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.accessibility;
+
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.DISPLAY_SETTINGS;
+
+import android.content.Context;
+
+/**
+ * The controller for the {@link TextReadingPreferenceFragment} from the display settings.
+ */
+public class TextReadingFragmentForDisplaySettingsController extends
+        TextReadingFragmentBaseController {
+    public TextReadingFragmentForDisplaySettingsController(Context context, String preferenceKey) {
+        // Pass the fixed entry point to the parent controller for logging.
+        super(context, preferenceKey, DISPLAY_SETTINGS);
+    }
+}
diff --git a/src/com/android/settings/accessibility/TextReadingFragmentForSuwController.java b/src/com/android/settings/accessibility/TextReadingFragmentForSuwController.java
new file mode 100644
index 0000000..332d9c5
--- /dev/null
+++ b/src/com/android/settings/accessibility/TextReadingFragmentForSuwController.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2022 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.accessibility;
+
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.SUW_VISION_SETTINGS;
+
+import android.content.Context;
+
+/**
+ * The controller for the {@link TextReadingPreferenceFragment} during the SetupWizard.
+ */
+public class TextReadingFragmentForSuwController extends TextReadingFragmentBaseController {
+    public TextReadingFragmentForSuwController(Context context, String preferenceKey) {
+        // Pass the fixed entry point to the parent controller for logging.
+        super(context, preferenceKey, SUW_VISION_SETTINGS);
+    }
+}
diff --git a/src/com/android/settings/accessibility/TextReadingPreferenceFragment.java b/src/com/android/settings/accessibility/TextReadingPreferenceFragment.java
index a4ee961c..104be26 100644
--- a/src/com/android/settings/accessibility/TextReadingPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/TextReadingPreferenceFragment.java
@@ -22,9 +22,11 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.content.DialogInterface;
+import android.content.Intent;
 import android.os.Bundle;
 import android.widget.Toast;
 
+import androidx.annotation.IntDef;
 import androidx.appcompat.app.AlertDialog;
 
 import com.android.settings.R;
@@ -36,8 +38,11 @@
 
 import com.google.common.annotations.VisibleForTesting;
 
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -46,15 +51,40 @@
  */
 @SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
 public class TextReadingPreferenceFragment extends DashboardFragment {
+    public static final String EXTRA_LAUNCHED_FROM = "launched_from";
     private static final String TAG = "TextReadingPreferenceFragment";
-    private static final String FONT_SIZE_KEY = "font_size";
-    private static final String DISPLAY_SIZE_KEY = "display_size";
+    private static final String CATEGORY_FOR_ANYTHING_ELSE =
+            "com.android.settings.suggested.category.DISPLAY_SETTINGS";
+    static final String FONT_SIZE_KEY = "font_size";
+    static final String DISPLAY_SIZE_KEY = "display_size";
+    static final String BOLD_TEXT_KEY = "toggle_force_bold_text";
+    static final String HIGH_TEXT_CONTRAST_KEY = "toggle_high_text_contrast_preference";
+    static final String RESET_KEY = "reset";
     private static final String PREVIEW_KEY = "preview";
-    private static final String RESET_KEY = "reset";
-    private static final String BOLD_TEXT_KEY = "toggle_force_bold_text";
-    private static final String HIGHT_TEXT_CONTRAST_KEY = "toggle_high_text_contrast_preference";
     private static final String NEED_RESET_SETTINGS = "need_reset_settings";
     private FontWeightAdjustmentPreferenceController mFontWeightAdjustmentController;
+    private int mEntryPoint = EntryPoint.UNKNOWN_ENTRY;
+
+    /**
+     * The entry point which launches the {@link TextReadingPreferenceFragment}.
+     *
+     * <p>This should only be used for logging.
+     */
+    @Retention(RetentionPolicy.SOURCE)
+    @IntDef({
+            EntryPoint.UNKNOWN_ENTRY,
+            EntryPoint.SUW_VISION_SETTINGS,
+            EntryPoint.SUW_ANYTHING_ELSE,
+            EntryPoint.DISPLAY_SETTINGS,
+            EntryPoint.ACCESSIBILITY_SETTINGS,
+    })
+    @interface EntryPoint {
+        int UNKNOWN_ENTRY = 0;
+        int SUW_VISION_SETTINGS = 1;
+        int SUW_ANYTHING_ELSE = 2;
+        int DISPLAY_SETTINGS = 3;
+        int ACCESSIBILITY_SETTINGS = 4;
+    }
 
     @VisibleForTesting
     List<ResetStateListener> mResetStateListeners;
@@ -91,6 +121,8 @@
 
     @Override
     protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
+        updateEntryPoint();
+
         final List<AbstractPreferenceController> controllers = new ArrayList<>();
         final FontSizeData fontSizeData = new FontSizeData(context);
         final DisplaySizeData displaySizeData = createDisplaySizeData(context);
@@ -102,24 +134,29 @@
         final PreviewSizeSeekBarController fontSizeController = new PreviewSizeSeekBarController(
                 context, FONT_SIZE_KEY, fontSizeData);
         fontSizeController.setInteractionListener(previewController);
+        fontSizeController.setEntryPoint(mEntryPoint);
         controllers.add(fontSizeController);
 
         final PreviewSizeSeekBarController displaySizeController = new PreviewSizeSeekBarController(
                 context, DISPLAY_SIZE_KEY, displaySizeData);
         displaySizeController.setInteractionListener(previewController);
+        displaySizeController.setEntryPoint(mEntryPoint);
         controllers.add(displaySizeController);
 
         mFontWeightAdjustmentController =
                 new FontWeightAdjustmentPreferenceController(context, BOLD_TEXT_KEY);
+        mFontWeightAdjustmentController.setEntryPoint(mEntryPoint);
         controllers.add(mFontWeightAdjustmentController);
 
         final HighTextContrastPreferenceController highTextContrastController =
-                new HighTextContrastPreferenceController(context, HIGHT_TEXT_CONTRAST_KEY);
+                new HighTextContrastPreferenceController(context, HIGH_TEXT_CONTRAST_KEY);
+        highTextContrastController.setEntryPoint(mEntryPoint);
         controllers.add(highTextContrastController);
 
         final TextReadingResetController resetController =
                 new TextReadingResetController(context, RESET_KEY,
                         v -> showDialog(DialogEnums.DIALOG_RESET_SETTINGS));
+        resetController.setEntryPoint(mEntryPoint);
         controllers.add(resetController);
 
         return controllers;
@@ -162,6 +199,24 @@
         return new DisplaySizeData(context);
     }
 
+    private void updateEntryPoint() {
+        final Bundle bundle = getArguments();
+        if (bundle != null && bundle.containsKey(EXTRA_LAUNCHED_FROM)) {
+            mEntryPoint = bundle.getInt(EXTRA_LAUNCHED_FROM, EntryPoint.UNKNOWN_ENTRY);
+            return;
+        }
+
+        final Intent intent = getIntent();
+        if (intent == null) {
+            mEntryPoint = EntryPoint.UNKNOWN_ENTRY;
+            return;
+        }
+
+        final Set<String> categories = intent.getCategories();
+        mEntryPoint = categories != null && categories.contains(CATEGORY_FOR_ANYTHING_ELSE)
+                ? EntryPoint.SUW_ANYTHING_ELSE : EntryPoint.UNKNOWN_ENTRY;
+    }
+
     private void onPositiveButtonClicked(DialogInterface dialog, int which) {
         // To avoid showing the dialog again, probably the onDetach() of SettingsDialogFragment
         // was interrupted by unexpectedly recreating the activity.
diff --git a/src/com/android/settings/accessibility/TextReadingResetController.java b/src/com/android/settings/accessibility/TextReadingResetController.java
index 152ad5f..30a94c2 100644
--- a/src/com/android/settings/accessibility/TextReadingResetController.java
+++ b/src/com/android/settings/accessibility/TextReadingResetController.java
@@ -23,7 +23,9 @@
 import androidx.preference.PreferenceScreen;
 
 import com.android.settings.R;
+import com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint;
 import com.android.settings.core.BasePreferenceController;
+import com.android.settings.core.instrumentation.SettingsStatsLog;
 import com.android.settingslib.widget.LayoutPreference;
 
 /**
@@ -32,6 +34,9 @@
 class TextReadingResetController extends BasePreferenceController {
     private final View.OnClickListener mOnResetClickListener;
 
+    @EntryPoint
+    private int mEntryPoint;
+
     TextReadingResetController(Context context, String preferenceKey,
             @Nullable View.OnClickListener listener) {
         super(context, preferenceKey);
@@ -52,11 +57,26 @@
         view.setOnClickListener(v -> {
             if (mOnResetClickListener != null) {
                 mOnResetClickListener.onClick(v);
+
+                SettingsStatsLog.write(
+                        SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED,
+                        AccessibilityStatsLogUtils.convertToItemKeyName(getPreferenceKey()),
+                        /* reset */ -1,
+                        AccessibilityStatsLogUtils.convertToEntryPoint(mEntryPoint));
             }
         });
     }
 
     /**
+     * The entry point is used for logging.
+     *
+     * @param entryPoint from which settings page
+     */
+    void setEntryPoint(@EntryPoint int entryPoint) {
+        mEntryPoint = entryPoint;
+    }
+
+    /**
      * Interface for resetting to default state.
      */
     interface ResetStateListener {
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index 3eae885..062bfc5 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -330,8 +330,8 @@
             if (className.equals(Settings.NotificationReviewPermissionsActivity.class.getName())) {
                 // Special-case for a case where a user is directed to the all apps notification
                 // preferences page via a notification prompt to review permissions settings.
-                android.provider.Settings.Secure.putInt(getContext().getContentResolver(),
-                        android.provider.Settings.Secure.REVIEW_PERMISSIONS_NOTIFICATION_STATE,
+                android.provider.Settings.Global.putInt(getContext().getContentResolver(),
+                        android.provider.Settings.Global.REVIEW_PERMISSIONS_NOTIFICATION_STATE,
                         1);  // USER_INTERACTED
             }
         } else if (className.equals(AppLocaleDetails.class.getName())) {
diff --git a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
index f1c578e..3df19be 100644
--- a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
+++ b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
@@ -68,7 +68,7 @@
     @Override
     public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
-        setLoading(true, false);
+        setEmptyText(R.string.premium_sms_none);
     }
 
     @Override
@@ -138,8 +138,6 @@
 
     private void updatePrefs(ArrayList<AppEntry> apps) {
         if (apps == null) return;
-        setEmptyText(R.string.premium_sms_none);
-        setLoading(false, true);
         final PreferenceScreen screen = getPreferenceScreen();
         screen.removeAll();
         screen.setOrderingAsAdded(true);
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
index f3085bc..b1ffcf1 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
@@ -69,7 +69,7 @@
         mCm = cm;
         mVm = vm;
         mResources = resources;
-        mWorkPolicyUtils = new WorkPolicyUtils(mContext, mPm, mUm, mDpm);
+        mWorkPolicyUtils = new WorkPolicyUtils(mContext);
     }
 
     @Override
diff --git a/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java
index 8fb0d1e..db4cc53 100644
--- a/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java
@@ -424,6 +424,9 @@
 
     @VisibleForTesting
     void setUsageSummary(Preference preference, BatteryEntry entry) {
+        if (entry.getUid() == Process.SYSTEM_UID) {
+          return;
+        }
         // Only show summary when usage time is longer than one minute
         final long usageTimeMs = entry.getTimeInForegroundMs();
         if (shouldShowSummary(entry) && usageTimeMs >= DateUtils.MINUTE_IN_MILLIS) {
diff --git a/src/com/android/settings/fuelgauge/BatteryInfo.java b/src/com/android/settings/fuelgauge/BatteryInfo.java
index 98f19fe..b1e4c34 100644
--- a/src/com/android/settings/fuelgauge/BatteryInfo.java
+++ b/src/com/android/settings/fuelgauge/BatteryInfo.java
@@ -153,6 +153,7 @@
         new AsyncTask<Void, Void, BatteryInfo>() {
             @Override
             protected BatteryInfo doInBackground(Void... params) {
+                boolean shouldCloseBatteryUsageStats = false;
                 BatteryUsageStats stats;
                 if (batteryUsageStats != null) {
                     stats = batteryUsageStats;
@@ -160,6 +161,7 @@
                     try {
                         stats = context.getSystemService(BatteryStatsManager.class)
                                 .getBatteryUsageStats();
+                        shouldCloseBatteryUsageStats = true;
                     } catch (RuntimeException e) {
                         Log.e(TAG, "getBatteryInfo() from getBatteryUsageStats()", e);
                         // Use default BatteryUsageStats.
@@ -168,10 +170,12 @@
                 }
                 final BatteryInfo batteryInfo =
                         getBatteryInfo(context, stats, shortString);
-                try {
-                    stats.close();
-                } catch (Exception e) {
-                    Log.e(TAG, "BatteryUsageStats.close() failed", e);
+                if (shouldCloseBatteryUsageStats) {
+                    try {
+                        stats.close();
+                    } catch (Exception e) {
+                        Log.e(TAG, "BatteryUsageStats.close() failed", e);
+                    }
                 }
                 return batteryInfo;
             }
diff --git a/src/com/android/settings/fuelgauge/PowerUsageBase.java b/src/com/android/settings/fuelgauge/PowerUsageBase.java
index e950679..6563155 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageBase.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageBase.java
@@ -83,6 +83,7 @@
     public void onStop() {
         super.onStop();
         mBatteryBroadcastReceiver.unRegister();
+        closeBatteryUsageStatsIfNeeded();
     }
 
     protected void restartBatteryStatsLoader(int refreshType) {
@@ -104,16 +105,6 @@
         final long startTime = System.currentTimeMillis();
         historyPref.setBatteryUsageStats(mBatteryUsageStats);
         BatteryUtils.logRuntime(TAG, "updatePreference", startTime);
-        if (mBatteryUsageStats == null) {
-            return;
-        }
-        try {
-            mBatteryUsageStats.close();
-        } catch (Exception e) {
-            Log.e(TAG, "BatteryUsageStats.close() failed", e);
-        } finally {
-            mBatteryUsageStats = null;
-        }
     }
 
     private class BatteryUsageStatsLoaderCallbacks
@@ -130,6 +121,7 @@
         @Override
         public void onLoadFinished(Loader<BatteryUsageStats> loader,
                 BatteryUsageStats batteryUsageStats) {
+            closeBatteryUsageStatsIfNeeded();
             mBatteryUsageStats = batteryUsageStats;
             PowerUsageBase.this.onLoadFinished(mRefreshType);
         }
@@ -138,4 +130,17 @@
         public void onLoaderReset(Loader<BatteryUsageStats> loader) {
         }
     }
+
+    private void closeBatteryUsageStatsIfNeeded() {
+        if (mBatteryUsageStats == null) {
+            return;
+        }
+        try {
+            mBatteryUsageStats.close();
+        } catch (Exception e) {
+            Log.e(TAG, "BatteryUsageStats.close() failed", e);
+        } finally {
+            mBatteryUsageStats = null;
+        }
+    }
 }
diff --git a/src/com/android/settings/localepicker/AppLocalePickerActivity.java b/src/com/android/settings/localepicker/AppLocalePickerActivity.java
index 4700f3f..1ed6f5b 100644
--- a/src/com/android/settings/localepicker/AppLocalePickerActivity.java
+++ b/src/com/android/settings/localepicker/AppLocalePickerActivity.java
@@ -30,7 +30,6 @@
 import android.widget.FrameLayout;
 import android.widget.ListView;
 
-import com.android.internal.annotations.VisibleForTesting;
 import com.android.internal.app.LocalePickerWithRegion;
 import com.android.internal.app.LocaleStore;
 import com.android.settings.R;
@@ -38,10 +37,6 @@
 import com.android.settings.applications.appinfo.AppLocaleDetails;
 import com.android.settings.core.SettingsBaseActivity;
 
-/**
- * TODO(b/223503670): Add unit test for AppLocalePickerActivity.
- * A activity to show the locale picker and information page.
- */
 public class AppLocalePickerActivity extends SettingsBaseActivity
         implements LocalePickerWithRegion.LocaleSelectedListener {
     private static final String TAG = AppLocalePickerActivity.class.getSimpleName();
@@ -128,8 +123,7 @@
         return appLocaleDetailsContainer;
     }
 
-    @VisibleForTesting
-    void launchLocalePickerPage() {
+    private void launchLocalePickerPage() {
         // LocalePickerWithRegion use android.app.ListFragment. Thus, it can not use
         // getSupportFragmentManager() to add this into container.
         android.app.FragmentManager fragmentManager = getFragmentManager();
diff --git a/src/com/android/settings/network/SubscriptionsPreferenceController.java b/src/com/android/settings/network/SubscriptionsPreferenceController.java
index 218e3ec..44ad411 100644
--- a/src/com/android/settings/network/SubscriptionsPreferenceController.java
+++ b/src/com/android/settings/network/SubscriptionsPreferenceController.java
@@ -232,11 +232,11 @@
                 connectCarrierNetwork();
                 return true;
             });
-
-            mSubsGearPref.setOnGearClickListener(p ->
-                    MobileNetworkUtils.launchMobileNetworkSettings(mContext, subInfo));
         }
 
+        mSubsGearPref.setOnGearClickListener(p ->
+                MobileNetworkUtils.launchMobileNetworkSettings(mContext, subInfo));
+
         if (!(mContext.getSystemService(UserManager.class)).isAdminUser()) {
             mSubsGearPref.setGearEnabled(false);
         }
diff --git a/src/com/android/settings/notification/MediaVolumePreferenceController.java b/src/com/android/settings/notification/MediaVolumePreferenceController.java
index 978a4b4..c0d5610 100644
--- a/src/com/android/settings/notification/MediaVolumePreferenceController.java
+++ b/src/com/android/settings/notification/MediaVolumePreferenceController.java
@@ -35,6 +35,7 @@
 import com.android.settings.slices.CustomSliceRegistry;
 import com.android.settings.slices.SliceBackgroundWorker;
 import com.android.settingslib.media.MediaDevice;
+import com.android.settingslib.media.MediaOutputConstants;
 
 public class MediaVolumePreferenceController extends VolumeSeekBarPreferenceController {
     private static final String TAG = "MediaVolumePreCtrl";
@@ -106,8 +107,10 @@
 
         final Intent intent = new Intent();
         if (getWorker().isDeviceBroadcasting()) {
-            // TODO(b/229577323) : Get the intent action for the Media Output Broadcast Dialog
-            //  in SystemUI
+            intent.setPackage(MediaOutputConstants.SYSTEMUI_PACKAGE_NAME);
+            intent.setAction(MediaOutputConstants.ACTION_LAUNCH_MEDIA_OUTPUT_BROADCAST_DIALOG);
+            intent.putExtra(MediaOutputConstants.EXTRA_PACKAGE_NAME,
+                    getWorker().getActiveLocalMediaController().getPackageName());
         } else {
             // TODO(b/229577518) : Get the intent action of the Bluetooth Broadcast Dialog
             //  for user to choose the action
diff --git a/src/com/android/settings/widget/EmptyTextSettings.java b/src/com/android/settings/widget/EmptyTextSettings.java
index 87513dd..a6e5c60 100644
--- a/src/com/android/settings/widget/EmptyTextSettings.java
+++ b/src/com/android/settings/widget/EmptyTextSettings.java
@@ -43,8 +43,10 @@
         TypedValue value = new TypedValue();
         getContext().getTheme().resolveAttribute(android.R.attr.textAppearanceMedium, value, true);
         mEmpty.setTextAppearance(value.resourceId);
+        final int layoutHeight = getContext().getResources()
+                .getDimensionPixelSize(R.dimen.empty_text_layout_height);
         ((ViewGroup) view.findViewById(android.R.id.list_container)).addView(mEmpty,
-                new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
+                new LayoutParams(LayoutParams.MATCH_PARENT, layoutHeight));
         setEmptyView(mEmpty);
     }
 
diff --git a/tests/robotests/src/com/android/settings/accessibility/TextReadingFragmentBaseControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/TextReadingFragmentBaseControllerTest.java
new file mode 100644
index 0000000..ad6a895
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/accessibility/TextReadingFragmentBaseControllerTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2022 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.accessibility;
+
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EXTRA_LAUNCHED_FROM;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.ACCESSIBILITY_SETTINGS;
+import static com.android.settings.accessibility.TextReadingPreferenceFragment.EntryPoint.UNKNOWN_ENTRY;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.content.Context;
+
+import androidx.preference.Preference;
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+
+/**
+ * Tests for {@link TextReadingFragmentBaseController}.
+ */
+@RunWith(RobolectricTestRunner.class)
+public class TextReadingFragmentBaseControllerTest {
+    private static final String FRAGMENT_PREF_KEY = "FRAGMENT_PREF_KEY";
+    private final Context mContext = ApplicationProvider.getApplicationContext();
+
+    @Test
+    public void handlePreferenceClick_getExtraWithA11ySettingsEntryPoint() {
+        final Preference a11ySettingsPreference = new Preference(mContext);
+        a11ySettingsPreference.setKey(FRAGMENT_PREF_KEY);
+        final TextReadingFragmentBaseController mA11ySettingsFragmentController =
+                new TextReadingFragmentBaseController(mContext, FRAGMENT_PREF_KEY,
+                        ACCESSIBILITY_SETTINGS);
+
+        mA11ySettingsFragmentController.handlePreferenceTreeClick(a11ySettingsPreference);
+
+        assertThat(a11ySettingsPreference.getExtras().getInt(EXTRA_LAUNCHED_FROM,
+                UNKNOWN_ENTRY)).isEqualTo(ACCESSIBILITY_SETTINGS);
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
index 0005e71..87a447d 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
@@ -105,6 +105,10 @@
         when(mContext.getApplicationContext()).thenReturn(mContext);
         resetAndInitializePackageManager();
         when(mUserManager.getProfiles(mUserId)).thenReturn(mProfiles);
+        when(mContext.getSystemService(Context.DEVICE_POLICY_SERVICE))
+                .thenReturn(mDevicePolicyManager);
+        when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
+        when(mContext.getPackageManager()).thenReturn(mPackageManager);
         mProfiles.add(new UserInfo(mUserId, "", "", 0 /* flags */));
         mResources = RuntimeEnvironment.application.getResources();
 
diff --git a/tests/robotests/src/com/android/settings/localepicker/AppLocalePickerActivityTest.java b/tests/robotests/src/com/android/settings/localepicker/AppLocalePickerActivityTest.java
new file mode 100644
index 0000000..4d5e0b9
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/localepicker/AppLocalePickerActivityTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2022 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.localepicker;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.Activity;
+import android.app.ApplicationPackageManager;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.InstallSourceInfo;
+import android.net.Uri;
+import android.os.Process;
+import android.os.UserHandle;
+import android.telephony.TelephonyManager;
+
+import androidx.fragment.app.Fragment;
+
+import com.android.settings.R;
+import com.android.settings.applications.AppInfoBase;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+import org.robolectric.Robolectric;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.Shadows;
+import org.robolectric.android.controller.ActivityController;
+import org.robolectric.annotation.Config;
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
+import org.robolectric.shadows.ShadowTelephonyManager;
+
+@RunWith(RobolectricTestRunner.class)
+@Config(
+        shadows = {
+                AppLocalePickerActivityTest.ShadowApplicationPackageManager.class,
+        })
+public class AppLocalePickerActivityTest {
+    private static final String TEST_PACKAGE_NAME = "com.android.settings";
+    private static final Uri TEST_PACKAGE_URI = Uri.parse("package:" + TEST_PACKAGE_NAME);
+
+    @Rule
+    public MockitoRule rule = MockitoJUnit.rule();
+
+    @Test
+    public void launchAppLocalePickerActivity_hasPackageName_success() {
+        ActivityController<TestAppLocalePickerActivity> controller =
+                initActivityController(true);
+
+        controller.create();
+
+        assertThat(controller.get().isFinishing()).isFalse();
+    }
+
+    @Test
+    public void launchAppLocalePickerActivity_intentWithoutPackageName_failed() {
+        ActivityController<TestAppLocalePickerActivity> controller =
+                initActivityController(false);
+
+        controller.create();
+
+        assertThat(controller.get().isFinishing()).isTrue();
+    }
+
+    private ActivityController<TestAppLocalePickerActivity> initActivityController(
+            boolean hasPackageName) {
+        Intent data = new Intent();
+        if (hasPackageName) {
+            data.setData(TEST_PACKAGE_URI);
+        }
+        data.putExtra(AppInfoBase.ARG_PACKAGE_UID, UserHandle.getUserId(Process.myUid()));
+        ActivityController<TestAppLocalePickerActivity> activityController =
+                Robolectric.buildActivity(TestAppLocalePickerActivity.class, data);
+        Activity activity = activityController.get();
+
+        ShadowTelephonyManager shadowTelephonyManager = Shadows.shadowOf(
+                activity.getSystemService(TelephonyManager.class));
+        shadowTelephonyManager.setSimCountryIso("US");
+        shadowTelephonyManager.setNetworkCountryIso("US");
+
+        return activityController;
+    }
+
+    private static class TestAppLocalePickerActivity extends AppLocalePickerActivity {
+        @Override
+        public Context createContextAsUser(UserHandle user, int flags) {
+            // return the current context as a work profile
+            return this;
+        }
+    }
+
+    @Implements(ApplicationPackageManager.class)
+    public static class ShadowApplicationPackageManager extends
+            org.robolectric.shadows.ShadowApplicationPackageManager {
+
+        @Implementation
+        protected Object getInstallSourceInfo(String packageName) {
+            return new InstallSourceInfo("", null, null, "");
+        }
+    }
+}
