Snap for 11959661 from 076b7ee22a to 24Q3-release

Change-Id: I751144b8ab0d9d594a74d699eb004fa4c8435ea3
This commit is contained in:
Android Build Coastguard Worker
2024-06-12 23:23:03 +00:00
31 changed files with 134 additions and 103 deletions

View File

@@ -4458,15 +4458,15 @@
<string name="trackpad_pointer_speed">Pointer speed</string> <string name="trackpad_pointer_speed">Pointer speed</string>
<!-- Title text for mouse pointer fill style. [CHAR LIMIT=35] --> <!-- Title text for mouse pointer fill style. [CHAR LIMIT=35] -->
<string name="pointer_fill_style">Pointer fill style</string> <string name="pointer_fill_style">Pointer fill style</string>
<!-- Content description for black pointer fill style. [CHAR LIMIT=35] --> <!-- Content description for black pointer fill style. [CHAR LIMIT=60] -->
<string name="pointer_fill_style_black_button">Change pointer fill style to black</string> <string name="pointer_fill_style_black_button">Change pointer fill style to black</string>
<!-- Content description for green pointer fill style. [CHAR LIMIT=35] --> <!-- Content description for green pointer fill style. [CHAR LIMIT=60] -->
<string name="pointer_fill_style_green_button">Change pointer fill style to green</string> <string name="pointer_fill_style_green_button">Change pointer fill style to green</string>
<!-- Content description for yellow pointer fill style. [CHAR LIMIT=35] --> <!-- Content description for yellow pointer fill style. [CHAR LIMIT=60] -->
<string name="pointer_fill_style_yellow_button">Change pointer fill style to yellow</string> <string name="pointer_fill_style_yellow_button">Change pointer fill style to yellow</string>
<!-- Content description for pink pointer fill style. [CHAR LIMIT=35] --> <!-- Content description for pink pointer fill style. [CHAR LIMIT=60] -->
<string name="pointer_fill_style_pink_button">Change pointer fill style to pink</string> <string name="pointer_fill_style_pink_button">Change pointer fill style to pink</string>
<!-- Content description for blue pointer fill style. [CHAR LIMIT=35] --> <!-- Content description for blue pointer fill style. [CHAR LIMIT=60] -->
<string name="pointer_fill_style_blue_button">Change pointer fill style to blue</string> <string name="pointer_fill_style_blue_button">Change pointer fill style to blue</string>
<!-- Title for the button to trigger the 'touch gesture' education. [CHAR LIMIT=35] --> <!-- Title for the button to trigger the 'touch gesture' education. [CHAR LIMIT=35] -->
<string name="trackpad_touch_gesture">Learn touchpad gestures</string> <string name="trackpad_touch_gesture">Learn touchpad gestures</string>
@@ -8732,9 +8732,9 @@
<string name="notif_listener_more_settings_desc">More settings are available inside this app</string> <string name="notif_listener_more_settings_desc">More settings are available inside this app</string>
<!-- Title for Polite Notifications setting [CHAR LIMIT=45]--> <!-- Title for Polite Notifications setting [CHAR LIMIT=45]-->
<string name="notification_polite_title">Cooldown</string> <string name="notification_polite_title">Adaptive Notifications</string>
<string name="notification_polite_main_control_title">Use Cooldown</string> <string name="notification_polite_main_control_title">Use adaptive notifications</string>
<string name="notification_polite_description">When you get many notifications within a short time span, your device will minimize sound interruptions and pop-ups on the screen. Calls, alarms, and priority conversations will still alert as notmal, and all delivered notifications are easy to find in the Shade.</string> <string name="notification_polite_description">When you get many notifications within a short time, your phone will lower volume and minimize pop-ups on screen for up to two minutes. Calls, alarms, and priority conversations still vibrate, make a sound, or show up on the screen, and all notifications are easy to find when you pull down from the top of the screen.</string>
<string name="notification_polite_work">Apply to work profiles</string> <string name="notification_polite_work">Apply to work profiles</string>
<string name="notification_polite_work_summary">Apply to work profile apps</string> <string name="notification_polite_work_summary">Apply to work profile apps</string>

View File

@@ -116,9 +116,19 @@
<PreferenceCategory <PreferenceCategory
android:key="advanced_section_header" android:key="advanced_section_header"
android:title="@string/advanced_section_header"> android:title="@string/advanced_section_header">
<!--Adaptive Notifications-->
<Preference
android:fragment="com.android.settings.notification.PoliteNotificationsPreferenceFragment"
android:key="polite_notifications_preference"
android:order="17"
android:persistent="false"
android:title="@string/notification_polite_title"
settings:controller="com.android.settings.notification.PoliteNotificationsPreferenceController" />
<com.android.settingslib.RestrictedPreference <com.android.settingslib.RestrictedPreference
android:key="zen_mode_notifications" android:key="zen_mode_notifications"
android:order="17" android:order="18"
android:title="@string/zen_mode_settings_title" android:title="@string/zen_mode_settings_title"
settings:useAdminDisabledSummary="true" settings:useAdminDisabledSummary="true"
android:fragment="com.android.settings.notification.zen.ZenModeSettings" android:fragment="com.android.settings.notification.zen.ZenModeSettings"
@@ -127,7 +137,7 @@
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="lock_screen_show_only_unseen_notifs" android:key="lock_screen_show_only_unseen_notifs"
android:order="18" android:order="19"
android:title="@string/unseen_notifs_lock_screen" android:title="@string/unseen_notifs_lock_screen"
android:summary="@string/unseen_notifs_lock_screen_summary" android:summary="@string/unseen_notifs_lock_screen_summary"
settings:controller="com.android.settings.notification.ShowOnlyUnseenNotificationsOnLockscreenPreferenceController" settings:controller="com.android.settings.notification.ShowOnlyUnseenNotificationsOnLockscreenPreferenceController"
@@ -136,7 +146,7 @@
<Preference <Preference
android:fragment="com.android.settings.accessibility.FlashNotificationsPreferenceFragment" android:fragment="com.android.settings.accessibility.FlashNotificationsPreferenceFragment"
android:key="flash_notifications_preference" android:key="flash_notifications_preference"
android:order="19" android:order="20"
android:persistent="false" android:persistent="false"
android:title="@string/flash_notifications_title" android:title="@string/flash_notifications_title"
settings:searchable="false" settings:searchable="false"
@@ -144,7 +154,7 @@
<com.android.settingslib.RestrictedPreference <com.android.settingslib.RestrictedPreference
android:key="app_and_notif_cell_broadcast_settings" android:key="app_and_notif_cell_broadcast_settings"
android:order="20" android:order="21"
android:title="@string/cell_broadcast_settings" android:title="@string/cell_broadcast_settings"
settings:useAdminDisabledSummary="true"> settings:useAdminDisabledSummary="true">
<intent <intent
@@ -155,43 +165,36 @@
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="silent_icons" android:key="silent_icons"
android:order="21" android:order="22"
android:title="@string/silent_notifications_status_bar" android:title="@string/silent_notifications_status_bar"
settings:controller="com.android.settings.notification.SilentStatusBarPreferenceController"/> settings:controller="com.android.settings.notification.SilentStatusBarPreferenceController"/>
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="show_snooze_options" android:key="show_snooze_options"
android:order="22" android:order="23"
android:title="@string/snooze_options_title" android:title="@string/snooze_options_title"
settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" /> settings:controller="com.android.settings.notification.SnoozeNotificationPreferenceController" />
<!-- Notification badging --> <!-- Notification badging -->
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="notification_badging" android:key="notification_badging"
android:order="23" android:order="24"
android:title="@string/notification_badging_title" android:title="@string/notification_badging_title"
settings:controller="com.android.settings.notification.BadgingNotificationPreferenceController"/> settings:controller="com.android.settings.notification.BadgingNotificationPreferenceController"/>
<!-- Pulse notification light, on devices that support it --> <!-- Pulse notification light, on devices that support it -->
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="notification_pulse" android:key="notification_pulse"
android:order="24" android:order="25"
android:title="@string/notification_pulse_title" android:title="@string/notification_pulse_title"
settings:controller="com.android.settings.notification.PulseNotificationPreferenceController"/> settings:controller="com.android.settings.notification.PulseNotificationPreferenceController"/>
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="notification_assistant" android:key="notification_assistant"
android:order="25" android:order="26"
android:title="@string/notification_assistant_title" android:title="@string/notification_assistant_title"
android:summary="@string/notification_assistant_summary" android:summary="@string/notification_assistant_summary"
settings:controller="com.android.settings.notification.NotificationAssistantPreferenceController"/> settings:controller="com.android.settings.notification.NotificationAssistantPreferenceController"/>
<Preference
android:fragment="com.android.settings.notification.PoliteNotificationsPreferenceFragment"
android:key="polite_notifications_preference"
android:order="26"
android:persistent="false"
android:title="@string/notification_polite_title"
settings:controller="com.android.settings.notification.PoliteNotificationsPreferenceController" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -270,6 +270,7 @@ public class ResetNetworkRequest {
if ((mResetOptions & RESET_IMS_STACK) != 0) { if ((mResetOptions & RESET_IMS_STACK) != 0) {
builder.resetIms(mSubscriptionIdToResetIms); builder.resetIms(mSubscriptionIdToResetIms);
} }
// Reset phone process and RILD may impact above components, keep them at the end
if ((mResetOptions & RESET_PHONE_PROCESS) != 0) { if ((mResetOptions & RESET_PHONE_PROCESS) != 0) {
builder.restartPhoneProcess(); builder.restartPhoneProcess();
} }

View File

@@ -148,7 +148,7 @@ public class AccessibilityHearingAidPreferenceController extends BasePreferenceC
// Check if another side of LE audio hearing aid is connected as a pair // Check if another side of LE audio hearing aid is connected as a pair
final Set<CachedBluetoothDevice> memberDevices = device.getMemberDevice(); final Set<CachedBluetoothDevice> memberDevices = device.getMemberDevice();
if (memberDevices.stream().anyMatch(m -> m.isConnected())) { if (memberDevices.stream().anyMatch(m -> m.getDevice().isConnected())) {
return mContext.getString( return mContext.getString(
R.string.accessibility_hearingaid_left_and_right_side_device_summary, R.string.accessibility_hearingaid_left_and_right_side_device_summary,
name); name);
@@ -156,7 +156,7 @@ public class AccessibilityHearingAidPreferenceController extends BasePreferenceC
// Check if another side of ASHA hearing aid is connected as a pair // Check if another side of ASHA hearing aid is connected as a pair
final CachedBluetoothDevice subDevice = device.getSubDevice(); final CachedBluetoothDevice subDevice = device.getSubDevice();
if (subDevice != null && subDevice.isConnected()) { if (subDevice != null && subDevice.getDevice().isConnected()) {
return mContext.getString( return mContext.getString(
R.string.accessibility_hearingaid_left_and_right_side_device_summary, name); R.string.accessibility_hearingaid_left_and_right_side_device_summary, name);
} }

View File

@@ -28,9 +28,10 @@ import com.android.settingslib.development.AbstractEnableAdbPreferenceController
public class AdbPreferenceController extends AbstractEnableAdbPreferenceController implements public class AdbPreferenceController extends AbstractEnableAdbPreferenceController implements
PreferenceControllerMixin { PreferenceControllerMixin {
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
public AdbPreferenceController(Context context, DevelopmentSettingsDashboardFragment fragment) { public AdbPreferenceController(Context context,
@Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
} }

View File

@@ -40,7 +40,7 @@ public class BackAnimationPreferenceController extends DeveloperOptionsPreferenc
private static final int SETTING_VALUE_OFF = 0; private static final int SETTING_VALUE_OFF = 0;
private static final int SETTING_VALUE_ON = 1; private static final int SETTING_VALUE_ON = 1;
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
@VisibleForTesting @VisibleForTesting
BackAnimationPreferenceController(Context context) { BackAnimationPreferenceController(Context context) {

View File

@@ -21,6 +21,7 @@ import static com.android.settings.development.BluetoothLeAudioHwOffloadPreferen
import android.content.Context; import android.content.Context;
import android.os.SystemProperties; import android.os.SystemProperties;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -32,7 +33,7 @@ public class BluetoothA2dpHwOffloadPreferenceController extends DeveloperOptions
implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin { implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
private static final String PREFERENCE_KEY = "bluetooth_disable_a2dp_hw_offload"; private static final String PREFERENCE_KEY = "bluetooth_disable_a2dp_hw_offload";
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
static final String A2DP_OFFLOAD_DISABLED_PROPERTY = "persist.bluetooth.a2dp_offload.disabled"; static final String A2DP_OFFLOAD_DISABLED_PROPERTY = "persist.bluetooth.a2dp_offload.disabled";
static final String A2DP_OFFLOAD_SUPPORTED_PROPERTY = "ro.bluetooth.a2dp_offload.supported"; static final String A2DP_OFFLOAD_SUPPORTED_PROPERTY = "ro.bluetooth.a2dp_offload.supported";
@@ -41,7 +42,7 @@ public class BluetoothA2dpHwOffloadPreferenceController extends DeveloperOptions
boolean mChanged = false; boolean mChanged = false;
public BluetoothA2dpHwOffloadPreferenceController(Context context, public BluetoothA2dpHwOffloadPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
} }

View File

@@ -49,12 +49,8 @@ public class BluetoothLeAudioAllowListPreferenceController
BluetoothAdapter mBluetoothAdapter; BluetoothAdapter mBluetoothAdapter;
@VisibleForTesting boolean mLeAudioConnectionByDefault; @VisibleForTesting boolean mLeAudioConnectionByDefault;
private final DevelopmentSettingsDashboardFragment mFragment; public BluetoothLeAudioAllowListPreferenceController(Context context) {
public BluetoothLeAudioAllowListPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment;
mBluetoothAdapter = context.getSystemService(BluetoothManager.class).getAdapter(); mBluetoothAdapter = context.getSystemService(BluetoothManager.class).getAdapter();
mLeAudioConnectionByDefault = mLeAudioConnectionByDefault =
SystemProperties.getBoolean(LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY, true); SystemProperties.getBoolean(LE_AUDIO_CONNECTION_BY_DEFAULT_PROPERTY, true);

View File

@@ -24,6 +24,7 @@ import android.bluetooth.BluetoothStatusCodes;
import android.content.Context; import android.content.Context;
import android.os.SystemProperties; import android.os.SystemProperties;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -39,7 +40,7 @@ public class BluetoothLeAudioHwOffloadPreferenceController
implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin { implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
private static final String PREFERENCE_KEY = "bluetooth_disable_le_audio_hw_offload"; private static final String PREFERENCE_KEY = "bluetooth_disable_le_audio_hw_offload";
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
static final String LE_AUDIO_OFFLOAD_DISABLED_PROPERTY = static final String LE_AUDIO_OFFLOAD_DISABLED_PROPERTY =
"persist.bluetooth.leaudio_offload.disabled"; "persist.bluetooth.leaudio_offload.disabled";
@@ -53,7 +54,7 @@ public class BluetoothLeAudioHwOffloadPreferenceController
boolean mChanged = false; boolean mChanged = false;
public BluetoothLeAudioHwOffloadPreferenceController(Context context, public BluetoothLeAudioHwOffloadPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
mBluetoothAdapter = context.getSystemService(BluetoothManager.class).getAdapter(); mBluetoothAdapter = context.getSystemService(BluetoothManager.class).getAdapter();

View File

@@ -23,6 +23,7 @@ import android.content.Context;
import android.os.SystemProperties; import android.os.SystemProperties;
import android.sysprop.BluetoothProperties; import android.sysprop.BluetoothProperties;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -45,7 +46,7 @@ public class BluetoothLeAudioPreferenceController
static final String LE_AUDIO_SWITCHER_DISABLED_PROPERTY = static final String LE_AUDIO_SWITCHER_DISABLED_PROPERTY =
"persist.bluetooth.leaudio_switcher.disabled"; "persist.bluetooth.leaudio_switcher.disabled";
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
@VisibleForTesting @VisibleForTesting
BluetoothAdapter mBluetoothAdapter; BluetoothAdapter mBluetoothAdapter;
@@ -54,7 +55,7 @@ public class BluetoothLeAudioPreferenceController
boolean mChanged = false; boolean mChanged = false;
public BluetoothLeAudioPreferenceController(Context context, public BluetoothLeAudioPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
mBluetoothAdapter = context.getSystemService(BluetoothManager.class).getAdapter(); mBluetoothAdapter = context.getSystemService(BluetoothManager.class).getAdapter();

View File

@@ -22,6 +22,7 @@ import android.os.SystemProperties;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.ListPreference; import androidx.preference.ListPreference;
import androidx.preference.Preference; import androidx.preference.Preference;
@@ -42,10 +43,10 @@ public class BluetoothSnoopLogPreferenceController extends DeveloperOptionsPrefe
private final String[] mListValues; private final String[] mListValues;
private final String[] mListEntries; private final String[] mListEntries;
private DevelopmentSettingsDashboardFragment mFragment; @Nullable private DevelopmentSettingsDashboardFragment mFragment;
public BluetoothSnoopLogPreferenceController( public BluetoothSnoopLogPreferenceController(
Context context, DevelopmentSettingsDashboardFragment fragment) { Context context, @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mListValues = context.getResources() mListValues = context.getResources()
.getStringArray(com.android.settingslib.R.array.bt_hci_snoop_log_values); .getStringArray(com.android.settingslib.R.array.bt_hci_snoop_log_values);

View File

@@ -25,6 +25,7 @@ import android.sysprop.AdbProperties;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceScreen;
@@ -40,10 +41,10 @@ public class ClearAdbKeysPreferenceController extends DeveloperOptionsPreference
private static final String CLEAR_ADB_KEYS = "clear_adb_keys"; private static final String CLEAR_ADB_KEYS = "clear_adb_keys";
private final IAdbManager mAdbManager; private final IAdbManager mAdbManager;
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
public ClearAdbKeysPreferenceController(Context context, public ClearAdbKeysPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;

View File

@@ -22,6 +22,7 @@ import android.content.Context;
import android.os.Build; import android.os.Build;
import android.provider.Settings; import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -41,10 +42,10 @@ public class DesktopModePreferenceController extends DeveloperOptionsPreferenceC
@VisibleForTesting @VisibleForTesting
static final int SETTING_VALUE_ON = 1; static final int SETTING_VALUE_ON = 1;
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
public DesktopModePreferenceController( public DesktopModePreferenceController(
Context context, DevelopmentSettingsDashboardFragment fragment) { Context context, @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
} }

View File

@@ -26,8 +26,7 @@ public class DevelopmentMemtagPagePreferenceController extends DeveloperOptionsP
implements PreferenceControllerMixin { implements PreferenceControllerMixin {
private static final String KEY_DEVELOPMENT_MEMTAG_PAGE = "development_memtag_page"; private static final String KEY_DEVELOPMENT_MEMTAG_PAGE = "development_memtag_page";
public DevelopmentMemtagPagePreferenceController( public DevelopmentMemtagPagePreferenceController(Context context) {
Context context, DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
} }

View File

@@ -655,7 +655,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
controllers.add(new BugReportPreferenceController(context)); controllers.add(new BugReportPreferenceController(context));
controllers.add(new BugReportHandlerPreferenceController(context)); controllers.add(new BugReportHandlerPreferenceController(context));
controllers.add(new SystemServerHeapDumpPreferenceController(context)); controllers.add(new SystemServerHeapDumpPreferenceController(context));
controllers.add(new DevelopmentMemtagPagePreferenceController(context, fragment)); controllers.add(new DevelopmentMemtagPagePreferenceController(context));
controllers.add(new LocalBackupPasswordPreferenceController(context)); controllers.add(new LocalBackupPasswordPreferenceController(context));
controllers.add(new StayAwakePreferenceController(context, lifecycle)); controllers.add(new StayAwakePreferenceController(context, lifecycle));
controllers.add(new HdcpCheckingPreferenceController(context)); controllers.add(new HdcpCheckingPreferenceController(context));
@@ -706,7 +706,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
controllers.add(new BluetoothLeAudioPreferenceController(context, fragment)); controllers.add(new BluetoothLeAudioPreferenceController(context, fragment));
controllers.add(new BluetoothLeAudioModePreferenceController(context, fragment)); controllers.add(new BluetoothLeAudioModePreferenceController(context, fragment));
controllers.add(new BluetoothLeAudioDeviceDetailsPreferenceController(context)); controllers.add(new BluetoothLeAudioDeviceDetailsPreferenceController(context));
controllers.add(new BluetoothLeAudioAllowListPreferenceController(context, fragment)); controllers.add(new BluetoothLeAudioAllowListPreferenceController(context));
controllers.add(new BluetoothA2dpHwOffloadPreferenceController(context, fragment)); controllers.add(new BluetoothA2dpHwOffloadPreferenceController(context, fragment));
controllers.add(new BluetoothLeAudioHwOffloadPreferenceController(context, fragment)); controllers.add(new BluetoothLeAudioHwOffloadPreferenceController(context, fragment));
controllers.add(new BluetoothMaxConnectedAudioDevicesPreferenceController(context)); controllers.add(new BluetoothMaxConnectedAudioDevicesPreferenceController(context));

View File

@@ -34,6 +34,7 @@ import android.widget.ProgressBar;
import android.widget.Toast; import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
@@ -86,7 +87,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
private static final int OFFSET_TO_FILE_NAME = 30; private static final int OFFSET_TO_FILE_NAME = 30;
public static final String EXPERIMENTAL_UPDATE_TITLE = "Android 16K Kernel Experimental Update"; public static final String EXPERIMENTAL_UPDATE_TITLE = "Android 16K Kernel Experimental Update";
private @NonNull DevelopmentSettingsDashboardFragment mFragment; private @Nullable DevelopmentSettingsDashboardFragment mFragment;
private boolean mEnable16k; private boolean mEnable16k;
private final ListeningExecutorService mExecutorService = private final ListeningExecutorService mExecutorService =
@@ -95,7 +96,7 @@ public class Enable16kPagesPreferenceController extends DeveloperOptionsPreferen
private AlertDialog mProgressDialog; private AlertDialog mProgressDialog;
public Enable16kPagesPreferenceController( public Enable16kPagesPreferenceController(
@NonNull Context context, @NonNull DevelopmentSettingsDashboardFragment fragment) { @NonNull Context context, @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
this.mFragment = fragment; this.mFragment = fragment;
mEnable16k = Enable16kUtils.isUsing16kbPages(); mEnable16k = Enable16kUtils.isUsing16kbPages();

View File

@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.Build; import android.os.Build;
import android.provider.Settings; import android.provider.Settings;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -39,10 +40,10 @@ public class FreeformWindowsPreferenceController extends DeveloperOptionsPrefere
@VisibleForTesting @VisibleForTesting
static final int SETTING_VALUE_ON = 1; static final int SETTING_VALUE_ON = 1;
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
public FreeformWindowsPreferenceController( public FreeformWindowsPreferenceController(
Context context, DevelopmentSettingsDashboardFragment fragment) { Context context, @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
} }

View File

@@ -28,10 +28,10 @@ import com.android.settingslib.development.AbstractLogpersistPreferenceControlle
public class LogPersistPreferenceController extends AbstractLogpersistPreferenceController public class LogPersistPreferenceController extends AbstractLogpersistPreferenceController
implements PreferenceControllerMixin { implements PreferenceControllerMixin {
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
public LogPersistPreferenceController(Context context, public LogPersistPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment, Lifecycle lifecycle) { @Nullable DevelopmentSettingsDashboardFragment fragment, Lifecycle lifecycle) {
super(context, lifecycle); super(context, lifecycle);
mFragment = fragment; mFragment = fragment;

View File

@@ -30,6 +30,7 @@ import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
@@ -45,12 +46,12 @@ public class MockLocationAppPreferenceController extends DeveloperOptionsPrefere
private static final String MOCK_LOCATION_APP_KEY = "mock_location_app"; private static final String MOCK_LOCATION_APP_KEY = "mock_location_app";
private static final int[] MOCK_LOCATION_APP_OPS = new int[]{AppOpsManager.OP_MOCK_LOCATION}; private static final int[] MOCK_LOCATION_APP_OPS = new int[]{AppOpsManager.OP_MOCK_LOCATION};
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
private final AppOpsManager mAppsOpsManager; private final AppOpsManager mAppsOpsManager;
private final PackageManager mPackageManager; private final PackageManager mPackageManager;
public MockLocationAppPreferenceController(Context context, public MockLocationAppPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;

View File

@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.SystemProperties; import android.os.SystemProperties;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -45,10 +46,10 @@ public class NfcSnoopLogPreferenceController extends
@VisibleForTesting @VisibleForTesting
boolean mChanged = false; boolean mChanged = false;
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
public NfcSnoopLogPreferenceController(Context context, public NfcSnoopLogPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
} }

View File

@@ -20,6 +20,7 @@ import android.content.Context;
import android.os.SystemProperties; import android.os.SystemProperties;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -45,10 +46,10 @@ public class NfcVerboseVendorLogPreferenceController
@VisibleForTesting @VisibleForTesting
boolean mChanged = false; boolean mChanged = false;
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
public NfcVerboseVendorLogPreferenceController(Context context, public NfcVerboseVendorLogPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
} }

View File

@@ -31,6 +31,7 @@ import android.telephony.TelephonyManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceScreen;
@@ -54,11 +55,11 @@ public class OemUnlockPreferenceController extends DeveloperOptionsPreferenceCon
private final UserManager mUserManager; private final UserManager mUserManager;
private final TelephonyManager mTelephonyManager; private final TelephonyManager mTelephonyManager;
private final Activity mActivity; private final Activity mActivity;
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
private RestrictedSwitchPreference mPreference; private RestrictedSwitchPreference mPreference;
public OemUnlockPreferenceController(Context context, Activity activity, public OemUnlockPreferenceController(Context context, Activity activity,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
if (!TextUtils.equals(SystemProperties.get(OEM_UNLOCK_SUPPORTED_KEY, UNSUPPORTED), if (!TextUtils.equals(SystemProperties.get(OEM_UNLOCK_SUPPORTED_KEY, UNSUPPORTED),

View File

@@ -28,6 +28,7 @@ import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
@@ -40,11 +41,11 @@ public class SelectDebugAppPreferenceController extends DeveloperOptionsPreferen
private static final String DEBUG_APP_KEY = "debug_app"; private static final String DEBUG_APP_KEY = "debug_app";
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
private final PackageManager mPackageManager; private final PackageManager mPackageManager;
public SelectDebugAppPreferenceController(Context context, public SelectDebugAppPreferenceController(Context context,
DevelopmentSettingsDashboardFragment fragment) { @Nullable DevelopmentSettingsDashboardFragment fragment) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
mPackageManager = mContext.getPackageManager(); mPackageManager = mContext.getPackageManager();

View File

@@ -22,6 +22,7 @@ import android.bluetooth.BluetoothDevice;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceScreen; import androidx.preference.PreferenceScreen;
@@ -41,11 +42,11 @@ public class BluetoothCodecDialogPreferenceController extends
private static final String KEY = "bluetooth_audio_codec_settings"; private static final String KEY = "bluetooth_audio_codec_settings";
private static final String TAG = "BtCodecCtr"; private static final String TAG = "BtCodecCtr";
private final Callback mCallback; @Nullable private final Callback mCallback;
public BluetoothCodecDialogPreferenceController(Context context, Lifecycle lifecycle, public BluetoothCodecDialogPreferenceController(Context context, Lifecycle lifecycle,
BluetoothA2dpConfigStore store, BluetoothA2dpConfigStore store,
Callback callback) { @Nullable Callback callback) {
super(context, lifecycle, store); super(context, lifecycle, store);
mCallback = callback; mCallback = callback;
} }

View File

@@ -21,6 +21,7 @@ import android.bluetooth.BluetoothDevice;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -36,11 +37,11 @@ public class BluetoothHDAudioPreferenceController extends AbstractBluetoothPrefe
private static final String KEY = "bluetooth_hd_audio_settings"; private static final String KEY = "bluetooth_hd_audio_settings";
private static final String TAG = "BtHDAudioCtr"; private static final String TAG = "BtHDAudioCtr";
private final Callback mCallback; @Nullable private final Callback mCallback;
public BluetoothHDAudioPreferenceController(Context context, Lifecycle lifecycle, public BluetoothHDAudioPreferenceController(Context context, Lifecycle lifecycle,
BluetoothA2dpConfigStore store, BluetoothA2dpConfigStore store,
Callback callback) { @Nullable Callback callback) {
super(context, lifecycle, store); super(context, lifecycle, store);
mCallback = callback; mCallback = callback;
} }

View File

@@ -23,6 +23,7 @@ import android.os.SystemProperties;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.TwoStatePreference; import androidx.preference.TwoStatePreference;
@@ -45,7 +46,7 @@ public class GraphicsDriverEnableAngleAsSystemDriverController
private static final String ENABLE_ANELE_AS_SYSTEM_DRIVER_KEY = "enable_angle_as_system_driver"; private static final String ENABLE_ANELE_AS_SYSTEM_DRIVER_KEY = "enable_angle_as_system_driver";
private final DevelopmentSettingsDashboardFragment mFragment; @Nullable private final DevelopmentSettingsDashboardFragment mFragment;
private final GraphicsDriverSystemPropertiesWrapper mSystemProperties; private final GraphicsDriverSystemPropertiesWrapper mSystemProperties;
@@ -83,7 +84,7 @@ public class GraphicsDriverEnableAngleAsSystemDriverController
} }
public GraphicsDriverEnableAngleAsSystemDriverController( public GraphicsDriverEnableAngleAsSystemDriverController(
Context context, DevelopmentSettingsDashboardFragment fragment) { Context context, @Nullable DevelopmentSettingsDashboardFragment fragment) {
this(context, fragment, new Injector()); this(context, fragment, new Injector());
} }
@@ -96,7 +97,7 @@ public class GraphicsDriverEnableAngleAsSystemDriverController
@VisibleForTesting @VisibleForTesting
GraphicsDriverEnableAngleAsSystemDriverController( GraphicsDriverEnableAngleAsSystemDriverController(
Context context, DevelopmentSettingsDashboardFragment fragment, Injector injector) { Context context, @Nullable DevelopmentSettingsDashboardFragment fragment, Injector injector) {
super(context); super(context);
mFragment = fragment; mFragment = fragment;
mSystemProperties = injector.createSystemPropertiesWrapper(); mSystemProperties = injector.createSystemPropertiesWrapper();

View File

@@ -256,6 +256,7 @@ public class ResetNetworkOperationBuilder {
* @return this * @return this
*/ */
public ResetNetworkOperationBuilder restartPhoneProcess() { public ResetNetworkOperationBuilder restartPhoneProcess() {
Runnable runnable = () -> {
try { try {
mContext.getContentResolver().call( mContext.getContentResolver().call(
getResetTelephonyContentProviderAuthority(), getResetTelephonyContentProviderAuthority(),
@@ -266,6 +267,8 @@ public class ResetNetworkOperationBuilder {
} catch (IllegalArgumentException iae) { } catch (IllegalArgumentException iae) {
Log.w(TAG, "Fail to restart phone process: " + iae); Log.w(TAG, "Fail to restart phone process: " + iae);
} }
};
mResetSequence.add(runnable);
return this; return this;
} }
@@ -275,6 +278,7 @@ public class ResetNetworkOperationBuilder {
* @return this * @return this
*/ */
public ResetNetworkOperationBuilder restartRild() { public ResetNetworkOperationBuilder restartRild() {
Runnable runnable = () -> {
try { try {
mContext.getContentResolver().call( mContext.getContentResolver().call(
getResetTelephonyContentProviderAuthority(), getResetTelephonyContentProviderAuthority(),
@@ -285,6 +289,8 @@ public class ResetNetworkOperationBuilder {
} catch (IllegalArgumentException iae) { } catch (IllegalArgumentException iae) {
Log.w(TAG, "Fail to restart RILD: " + iae); Log.w(TAG, "Fail to restart RILD: " + iae);
} }
};
mResetSequence.add(runnable);
return this; return this;
} }

View File

@@ -33,7 +33,7 @@ android_test {
], ],
platform_apis: true, platform_apis: true,
certificate: "platform", certificate: "platform",
test_suites: ["general-tests"], test_suites: ["device-tests"],
libs: [ libs: [
"android.test.runner", "android.test.runner",
"android.test.base", "android.test.base",
@@ -57,6 +57,6 @@ java_test_host {
data: [ data: [
":test_16kb_app", ":test_16kb_app",
], ],
test_suites: ["general-tests"], test_suites: ["device-tests"],
test_config: "AndroidTest.xml", test_config: "AndroidTest.xml",
} }

View File

@@ -75,6 +75,7 @@ android_robolectric_test {
//"src/com/android/settings/homepage/**/*.java", //"src/com/android/settings/homepage/**/*.java",
"src/com/android/settings/inputmethod/**/*.java", "src/com/android/settings/inputmethod/**/*.java",
"src/com/android/settings/network/ShadowServiceManagerExtend.java", "src/com/android/settings/network/ShadowServiceManagerExtend.java",
"src/com/android/settings/notification/modes/**/*.java",
"src/com/android/settings/password/**/*.java", "src/com/android/settings/password/**/*.java",
"src/com/android/settings/search/DatabaseIndexingUtils.java", "src/com/android/settings/search/DatabaseIndexingUtils.java",
"src/com/android/settings/testutils/**/*.java", "src/com/android/settings/testutils/**/*.java",

View File

@@ -19,6 +19,7 @@ package com.android.settings.accessibility;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import static org.robolectric.Shadows.shadowOf; import static org.robolectric.Shadows.shadowOf;
@@ -82,6 +83,8 @@ public class AccessibilityHearingAidPreferenceControllerTest {
private BluetoothAdapter mBluetoothAdapter; private BluetoothAdapter mBluetoothAdapter;
private ShadowBluetoothAdapter mShadowBluetoothAdapter; private ShadowBluetoothAdapter mShadowBluetoothAdapter;
private BluetoothDevice mBluetoothDevice; private BluetoothDevice mBluetoothDevice;
private BluetoothDevice mSubBluetoothDevice;
private final Context mContext = ApplicationProvider.getApplicationContext(); private final Context mContext = ApplicationProvider.getApplicationContext();
private Preference mHearingAidPreference; private Preference mHearingAidPreference;
@@ -143,8 +146,8 @@ public class AccessibilityHearingAidPreferenceControllerTest {
public void getSummary_connectedAshaHearingAidBothSide_connectedBothSideSummary() { public void getSummary_connectedAshaHearingAidBothSide_connectedBothSideSummary() {
when(mCachedBluetoothDevice.getDeviceSide()).thenReturn( when(mCachedBluetoothDevice.getDeviceSide()).thenReturn(
HearingAidInfo.DeviceSide.SIDE_LEFT); HearingAidInfo.DeviceSide.SIDE_LEFT);
when(mCachedSubBluetoothDevice.isConnected()).thenReturn(true);
when(mCachedBluetoothDevice.getSubDevice()).thenReturn(mCachedSubBluetoothDevice); when(mCachedBluetoothDevice.getSubDevice()).thenReturn(mCachedSubBluetoothDevice);
when(mSubBluetoothDevice.isConnected()).thenReturn(true);
when(mHearingAidProfile.getConnectedDevices()).thenReturn(generateHearingAidDeviceList()); when(mHearingAidProfile.getConnectedDevices()).thenReturn(generateHearingAidDeviceList());
mPreferenceController.onStart(); mPreferenceController.onStart();
@@ -211,8 +214,8 @@ public class AccessibilityHearingAidPreferenceControllerTest {
@Test @Test
public void getSummary_connectedLeAudioHearingAidBothSide_connectedBothSideSummary() { public void getSummary_connectedLeAudioHearingAidBothSide_connectedBothSideSummary() {
when(mCachedBluetoothDevice.getMemberDevice()).thenReturn(generateMemberDevices()); when(mCachedBluetoothDevice.getMemberDevice()).thenReturn(generateMemberDevices());
when(mCachedSubBluetoothDevice.isConnected()).thenReturn(true);
when(mHapClientProfile.getConnectedDevices()).thenReturn(generateHearingAidDeviceList()); when(mHapClientProfile.getConnectedDevices()).thenReturn(generateHearingAidDeviceList());
when(mSubBluetoothDevice.isConnected()).thenReturn(true);
mPreferenceController.onStart(); mPreferenceController.onStart();
Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED); Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED);
@@ -288,7 +291,8 @@ public class AccessibilityHearingAidPreferenceControllerTest {
mShadowBluetoothAdapter = Shadow.extract(mBluetoothAdapter); mShadowBluetoothAdapter = Shadow.extract(mBluetoothAdapter);
mShadowBluetoothAdapter.addSupportedProfiles(BluetoothProfile.HEARING_AID); mShadowBluetoothAdapter.addSupportedProfiles(BluetoothProfile.HEARING_AID);
mShadowBluetoothAdapter.addSupportedProfiles(BluetoothProfile.HAP_CLIENT); mShadowBluetoothAdapter.addSupportedProfiles(BluetoothProfile.HAP_CLIENT);
mBluetoothDevice = mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS); mBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS));
mSubBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2));
mBluetoothAdapter.enable(); mBluetoothAdapter.enable();
doReturn(mEventManager).when(mLocalBluetoothManager).getEventManager(); doReturn(mEventManager).when(mLocalBluetoothManager).getEventManager();
@@ -299,8 +303,12 @@ public class AccessibilityHearingAidPreferenceControllerTest {
when(mHearingAidProfile.isProfileReady()).thenReturn(true); when(mHearingAidProfile.isProfileReady()).thenReturn(true);
when(mHapClientProfile.isProfileReady()).thenReturn(true); when(mHapClientProfile.isProfileReady()).thenReturn(true);
when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedBluetoothDevice); when(mCachedDeviceManager.findDevice(mBluetoothDevice)).thenReturn(mCachedBluetoothDevice);
when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice);
when(mCachedBluetoothDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS); when(mCachedBluetoothDevice.getAddress()).thenReturn(TEST_DEVICE_ADDRESS);
when(mCachedBluetoothDevice.getName()).thenReturn(TEST_DEVICE_NAME); when(mCachedBluetoothDevice.getName()).thenReturn(TEST_DEVICE_NAME);
when(mCachedDeviceManager.findDevice(mSubBluetoothDevice)).thenReturn(
mCachedSubBluetoothDevice);
when(mCachedSubBluetoothDevice.getDevice()).thenReturn(mSubBluetoothDevice);
} }
private void sendIntent(Intent intent) { private void sendIntent(Intent intent) {
@@ -319,7 +327,7 @@ public class AccessibilityHearingAidPreferenceControllerTest {
// Generates different Bluetooth devices for testing multiple devices // Generates different Bluetooth devices for testing multiple devices
final List<BluetoothDevice> deviceList = new ArrayList<>(2); final List<BluetoothDevice> deviceList = new ArrayList<>(2);
deviceList.add(mBluetoothDevice); deviceList.add(mBluetoothDevice);
deviceList.add(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_2)); deviceList.add(mSubBluetoothDevice);
return deviceList; return deviceList;
} }

View File

@@ -188,7 +188,7 @@ public class ResetNetworkOperationBuilderTest {
doThrow(new IllegalArgumentException()).when(mContentProvider).call( doThrow(new IllegalArgumentException()).when(mContentProvider).call(
anyString(), anyString(), anyString(), any()); anyString(), anyString(), anyString(), any());
mBuilder.restartPhoneProcess(); mBuilder.restartPhoneProcess().build().run();
} }
@Test @Test
@@ -196,12 +196,12 @@ public class ResetNetworkOperationBuilderTest {
doThrow(new IllegalArgumentException()).when(mContentProvider).call( doThrow(new IllegalArgumentException()).when(mContentProvider).call(
anyString(), anyString(), anyString(), any()); anyString(), anyString(), anyString(), any());
mBuilder.restartRild(); mBuilder.restartRild().build().run();
} }
@Test @Test
public void restartPhoneProcess_withTelephonyContentProvider_shouldCallRestartPhoneProcess() { public void restartPhoneProcess_withTelephonyContentProvider_shouldCallRestartPhoneProcess() {
mBuilder.restartPhoneProcess(); mBuilder.restartPhoneProcess().build().run();
verify(mContentProvider).call( verify(mContentProvider).call(
eq(mBuilder.getResetTelephonyContentProviderAuthority()), eq(mBuilder.getResetTelephonyContentProviderAuthority()),
@@ -212,7 +212,7 @@ public class ResetNetworkOperationBuilderTest {
@Test @Test
public void restartRild_withTelephonyContentProvider_shouldCallRestartRild() { public void restartRild_withTelephonyContentProvider_shouldCallRestartRild() {
mBuilder.restartRild(); mBuilder.restartRild().build().run();
verify(mContentProvider).call( verify(mContentProvider).call(
eq(mBuilder.getResetTelephonyContentProviderAuthority()), eq(mBuilder.getResetTelephonyContentProviderAuthority()),