From 1106faf2cf9c98fa47c2429fd7cb5d7e96a14091 Mon Sep 17 00:00:00 2001 From: Marie Matheson Date: Mon, 14 Feb 2022 20:33:57 +0000 Subject: [PATCH 1/4] Send safety center status on boot Bug: 215517959 Test: atest SettingsUnitTests Change-Id: Id34d68063b2bacd07c932b294b36546160384e92 --- AndroidManifest.xml | 1 + .../SafetySourceBroadcastReceiver.java | 38 +++++++++--- .../SafetySourceBroadcastReceiverTest.java | 58 +++++++++++++++---- 3 files changed, 77 insertions(+), 20 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 92dfbe51aac..7665af3e0f6 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -4367,6 +4367,7 @@ android:exported="true"> + diff --git a/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiver.java b/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiver.java index 0fd0c0dee22..bdc52ad59ca 100644 --- a/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiver.java +++ b/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiver.java @@ -16,6 +16,8 @@ package com.android.settings.safetycenter; +import static android.content.Intent.ACTION_BOOT_COMPLETED; +import static android.safetycenter.SafetyCenterManager.ACTION_REFRESH_SAFETY_SOURCES; import static android.safetycenter.SafetyCenterManager.EXTRA_REFRESH_SAFETY_SOURCE_IDS; import android.content.BroadcastReceiver; @@ -24,6 +26,8 @@ import android.content.Intent; import com.google.common.collect.ImmutableList; +import java.util.List; + /** Broadcast receiver for handling requests from Safety Center for fresh data. */ public class SafetySourceBroadcastReceiver extends BroadcastReceiver { @@ -33,17 +37,33 @@ public class SafetySourceBroadcastReceiver extends BroadcastReceiver { return; } - String[] sourceIdsExtra = intent.getStringArrayExtra(EXTRA_REFRESH_SAFETY_SOURCE_IDS); - if (sourceIdsExtra != null && sourceIdsExtra.length > 0) { - ImmutableList sourceIds = ImmutableList.copyOf(sourceIdsExtra); - - if (sourceIds.contains(LockScreenSafetySource.SAFETY_SOURCE_ID)) { - LockScreenSafetySource.sendSafetyData(context); + if (ACTION_REFRESH_SAFETY_SOURCES.equals(intent.getAction())) { + String[] sourceIdsExtra = + intent.getStringArrayExtra(EXTRA_REFRESH_SAFETY_SOURCE_IDS); + if (sourceIdsExtra != null && sourceIdsExtra.length > 0) { + refreshSafetySources(context, ImmutableList.copyOf(sourceIdsExtra)); } + return; + } - if (sourceIds.contains(BiometricsSafetySource.SAFETY_SOURCE_ID)) { - BiometricsSafetySource.sendSafetyData(context); - } + + if (ACTION_BOOT_COMPLETED.equals(intent.getAction())) { + refreshAllSafetySources(context); } } + + private static void refreshSafetySources(Context context, List sourceIds) { + if (sourceIds.contains(LockScreenSafetySource.SAFETY_SOURCE_ID)) { + LockScreenSafetySource.sendSafetyData(context); + } + + if (sourceIds.contains(BiometricsSafetySource.SAFETY_SOURCE_ID)) { + BiometricsSafetySource.sendSafetyData(context); + } + } + + private static void refreshAllSafetySources(Context context) { + LockScreenSafetySource.sendSafetyData(context); + BiometricsSafetySource.sendSafetyData(context); + } } diff --git a/tests/unit/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiverTest.java b/tests/unit/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiverTest.java index 8806e509a94..6c9addd6a3e 100644 --- a/tests/unit/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiverTest.java +++ b/tests/unit/src/com/android/settings/safetycenter/SafetySourceBroadcastReceiverTest.java @@ -16,6 +16,7 @@ package com.android.settings.safetycenter; +import static android.safetycenter.SafetyCenterManager.ACTION_REFRESH_SAFETY_SOURCES; import static android.safetycenter.SafetyCenterManager.EXTRA_REFRESH_SAFETY_SOURCE_IDS; import static com.google.common.truth.Truth.assertThat; @@ -66,13 +67,25 @@ public class SafetySourceBroadcastReceiverTest { SafetyCenterStatusHolder.sInstance = null; } + @Test + public void sendSafetyData_whenSafetyCenterIsEnabled_withNoIntentAction_sendsNoData() { + when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true); + Intent intent = new Intent().putExtra(EXTRA_REFRESH_SAFETY_SOURCE_IDS, new String[]{}); + + new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent); + + verify(mSafetyCenterManagerWrapper, never()).sendSafetyCenterUpdate(any(), any()); + } + @Test public void sendSafetyData_whenSafetyCenterIsDisabled_sendsNoData() { when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(false); Intent intent = - new Intent().putExtra( - EXTRA_REFRESH_SAFETY_SOURCE_IDS, - new String[]{ LockScreenSafetySource.SAFETY_SOURCE_ID }); + new Intent() + .setAction(ACTION_REFRESH_SAFETY_SOURCES) + .putExtra( + EXTRA_REFRESH_SAFETY_SOURCE_IDS, + new String[]{ LockScreenSafetySource.SAFETY_SOURCE_ID }); new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent); @@ -82,7 +95,7 @@ public class SafetySourceBroadcastReceiverTest { @Test public void sendSafetyData_whenSafetyCenterIsEnabled_withNullSourceIds_sendsNoData() { when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true); - Intent intent = new Intent(); + Intent intent = new Intent().setAction(ACTION_REFRESH_SAFETY_SOURCES); new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent); @@ -92,7 +105,10 @@ public class SafetySourceBroadcastReceiverTest { @Test public void sendSafetyData_whenSafetyCenterIsEnabled_withNoSourceIds_sendsNoData() { when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true); - Intent intent = new Intent().putExtra(EXTRA_REFRESH_SAFETY_SOURCE_IDS, new String[]{}); + Intent intent = + new Intent() + .setAction(ACTION_REFRESH_SAFETY_SOURCES) + .putExtra(EXTRA_REFRESH_SAFETY_SOURCE_IDS, new String[]{}); new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent); @@ -103,9 +119,11 @@ public class SafetySourceBroadcastReceiverTest { public void sendSafetyData_withLockscreenSourceId_sendsLockscreenData() { when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true); Intent intent = - new Intent().putExtra( - EXTRA_REFRESH_SAFETY_SOURCE_IDS, - new String[]{ LockScreenSafetySource.SAFETY_SOURCE_ID }); + new Intent() + .setAction(ACTION_REFRESH_SAFETY_SOURCES) + .putExtra( + EXTRA_REFRESH_SAFETY_SOURCE_IDS, + new String[]{ LockScreenSafetySource.SAFETY_SOURCE_ID }); new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent); ArgumentCaptor captor = ArgumentCaptor.forClass(SafetySourceData.class); @@ -120,13 +138,31 @@ public class SafetySourceBroadcastReceiverTest { public void sendSafetyData_withBiometricsSourceId_sendsBiometricData() { when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true); Intent intent = - new Intent().putExtra( - EXTRA_REFRESH_SAFETY_SOURCE_IDS, - new String[]{ BiometricsSafetySource.SAFETY_SOURCE_ID }); + new Intent() + .setAction(ACTION_REFRESH_SAFETY_SOURCES) + .putExtra( + EXTRA_REFRESH_SAFETY_SOURCE_IDS, + new String[]{ BiometricsSafetySource.SAFETY_SOURCE_ID }); new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent); // TODO(b/215517420): Update this test when BiometricSafetySource is implemented. verify(mSafetyCenterManagerWrapper, never()).sendSafetyCenterUpdate(any(), any()); } + + @Test + public void sendSafetyData_onBootCompleted_sendsBiometricAndLockscreenData() { + when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true); + Intent intent = new Intent().setAction(Intent.ACTION_BOOT_COMPLETED); + + // TODO(b/215517420): Update this test when BiometricSafetySource is implemented to test + // that biometrics data is also sent. + new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent); + ArgumentCaptor captor = ArgumentCaptor.forClass(SafetySourceData.class); + verify(mSafetyCenterManagerWrapper, times(1)) + .sendSafetyCenterUpdate(any(), captor.capture()); + SafetySourceData safetySourceData = captor.getValue(); + + assertThat(safetySourceData.getId()).isEqualTo(LockScreenSafetySource.SAFETY_SOURCE_ID); + } } From fa5ab2e268ba5b3cdf043233ad2151bdd8d8c84e Mon Sep 17 00:00:00 2001 From: Edgar Wang Date: Thu, 17 Feb 2022 02:10:51 +0800 Subject: [PATCH 2/4] Replace SettingsSpinner with Spinner Bug: 219610512 Test: manual Change-Id: Ib8562a64299a6cb36f8225199f9432cb81e8e9f2 --- res/layout/apps_filter_spinner.xml | 4 +--- res/layout/data_usage_cycles.xml | 2 +- res/layout/manage_apps_filter_spinner.xml | 4 +--- res/layout/tare_dropdown_page.xml | 7 +++---- res/layout/tare_homepage.xml | 3 ++- .../android/settings/applications/ProcessStatsBase.java | 2 +- .../manageapplications/ManageApplications.java | 2 +- src/com/android/settings/datausage/CycleAdapter.java | 2 +- src/com/android/settings/datausage/SpinnerPreference.java | 4 ++-- .../settings/development/tare/DropdownActivity.java | 6 +++--- .../storage/StorageSelectionPreferenceController.java | 2 +- 11 files changed, 17 insertions(+), 21 deletions(-) diff --git a/res/layout/apps_filter_spinner.xml b/res/layout/apps_filter_spinner.xml index 1de570528be..fcdcb5e8756 100644 --- a/res/layout/apps_filter_spinner.xml +++ b/res/layout/apps_filter_spinner.xml @@ -21,13 +21,11 @@ android:layout_height="wrap_content" android:background="@android:color/transparent"> - - - diff --git a/res/layout/tare_dropdown_page.xml b/res/layout/tare_dropdown_page.xml index 79931e88938..674b189912d 100644 --- a/res/layout/tare_dropdown_page.xml +++ b/res/layout/tare_dropdown_page.xml @@ -6,15 +6,14 @@ android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".development.tare.DropdownActivity"> - + android:theme="@style/Widget.PopupWindow.Settings" /> + android:text="@string/tare_revert" + style="@style/ActionPrimaryButton" /> diff --git a/src/com/android/settings/applications/ProcessStatsBase.java b/src/com/android/settings/applications/ProcessStatsBase.java index 67fc4c1eb3f..ce1453ff635 100644 --- a/src/com/android/settings/applications/ProcessStatsBase.java +++ b/src/com/android/settings/applications/ProcessStatsBase.java @@ -30,7 +30,7 @@ import com.android.settings.SettingsPreferenceFragment; import com.android.settings.applications.ProcStatsData.MemInfo; import com.android.settings.core.SubSettingLauncher; import com.android.settingslib.core.instrumentation.Instrumentable; -import com.android.settingslib.widget.settingsspinner.SettingsSpinnerAdapter; +import com.android.settingslib.widget.SettingsSpinnerAdapter; public abstract class ProcessStatsBase extends SettingsPreferenceFragment implements OnItemSelectedListener { diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java index 0c1270621c1..a6ce6fbeb84 100644 --- a/src/com/android/settings/applications/manageapplications/ManageApplications.java +++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java @@ -135,7 +135,7 @@ import com.android.settingslib.applications.ApplicationsState.CompoundFilter; import com.android.settingslib.applications.ApplicationsState.VolumeFilter; import com.android.settingslib.fuelgauge.PowerAllowlistBackend; import com.android.settingslib.utils.ThreadUtils; -import com.android.settingslib.widget.settingsspinner.SettingsSpinnerAdapter; +import com.android.settingslib.widget.SettingsSpinnerAdapter; import com.google.android.material.appbar.AppBarLayout; diff --git a/src/com/android/settings/datausage/CycleAdapter.java b/src/com/android/settings/datausage/CycleAdapter.java index 1292d001435..2cabd8de452 100644 --- a/src/com/android/settings/datausage/CycleAdapter.java +++ b/src/com/android/settings/datausage/CycleAdapter.java @@ -27,7 +27,7 @@ import com.android.net.module.util.NetworkStatsUtils; import com.android.settings.Utils; import com.android.settingslib.net.ChartData; import com.android.settingslib.net.NetworkCycleData; -import com.android.settingslib.widget.settingsspinner.SettingsSpinnerAdapter; +import com.android.settingslib.widget.SettingsSpinnerAdapter; import java.time.ZonedDateTime; import java.util.Iterator; diff --git a/src/com/android/settings/datausage/SpinnerPreference.java b/src/com/android/settings/datausage/SpinnerPreference.java index 67298a14bb6..867930baa97 100644 --- a/src/com/android/settings/datausage/SpinnerPreference.java +++ b/src/com/android/settings/datausage/SpinnerPreference.java @@ -18,12 +18,12 @@ import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.widget.AdapterView; +import android.widget.Spinner; import androidx.preference.Preference; import androidx.preference.PreferenceViewHolder; import com.android.settings.R; -import com.android.settingslib.widget.settingsspinner.SettingsSpinner; public class SpinnerPreference extends Preference implements CycleAdapter.SpinnerInterface { @@ -63,7 +63,7 @@ public class SpinnerPreference extends Preference implements CycleAdapter.Spinne @Override public void onBindViewHolder(PreferenceViewHolder holder) { super.onBindViewHolder(holder); - SettingsSpinner spinner = (SettingsSpinner) holder.findViewById(R.id.cycles_spinner); + Spinner spinner = (Spinner) holder.findViewById(R.id.cycles_spinner); spinner.setAdapter(mAdapter); spinner.setSelection(mPosition); spinner.setOnItemSelectedListener(mOnSelectedListener); diff --git a/src/com/android/settings/development/tare/DropdownActivity.java b/src/com/android/settings/development/tare/DropdownActivity.java index c1a11fa7e3e..55f1fec0585 100644 --- a/src/com/android/settings/development/tare/DropdownActivity.java +++ b/src/com/android/settings/development/tare/DropdownActivity.java @@ -26,6 +26,7 @@ import android.widget.ArrayAdapter; import android.widget.Spinner; import com.android.settings.R; +import com.android.settingslib.widget.SettingsSpinnerAdapter; /** * Dropdown activity to allow for the user to easily switch between the different TARE @@ -58,9 +59,8 @@ public class DropdownActivity extends Activity { String[] policies = getResources().getStringArray(R.array.tare_policies); - ArrayAdapter arrayAdapter = new ArrayAdapter<>(DropdownActivity.this, - android.R.layout.simple_list_item_1, policies); - arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + ArrayAdapter arrayAdapter = new SettingsSpinnerAdapter(this); + arrayAdapter.addAll(policies); mSpinner.setAdapter(arrayAdapter); mSpinner.setSelection(policy); diff --git a/src/com/android/settings/deviceinfo/storage/StorageSelectionPreferenceController.java b/src/com/android/settings/deviceinfo/storage/StorageSelectionPreferenceController.java index 5d5a2a58194..d972575983a 100644 --- a/src/com/android/settings/deviceinfo/storage/StorageSelectionPreferenceController.java +++ b/src/com/android/settings/deviceinfo/storage/StorageSelectionPreferenceController.java @@ -26,8 +26,8 @@ import androidx.annotation.VisibleForTesting; import androidx.preference.PreferenceScreen; import com.android.settings.core.BasePreferenceController; +import com.android.settingslib.widget.SettingsSpinnerAdapter; import com.android.settingslib.widget.SettingsSpinnerPreference; -import com.android.settingslib.widget.settingsspinner.SettingsSpinnerAdapter; import java.util.ArrayList; import java.util.Collections; From a95180f2288783b1828bceba396fe3a420edb674 Mon Sep 17 00:00:00 2001 From: William Escande Date: Wed, 16 Feb 2022 20:00:59 +0100 Subject: [PATCH 3/4] Remove hidden Bluetooth dependencies Bug: 217736913 Test: pre-submit Change-Id: Ib4e12e8e350ffa08b48f58e8256991d7ed4fa013 --- ...ssibilityHearingAidPreferenceControllerTest.java | 2 +- .../BluetoothDetailsControllerTestBase.java | 2 +- .../bluetooth/BluetoothPairingControllerTest.java | 13 ++++++++++++- .../AudioOutputSwitchPreferenceControllerTest.java | 2 +- ...dsFreeProfileOutputPreferenceControllerTest.java | 2 +- .../sound/MediaOutputPreferenceControllerTest.java | 2 +- 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java index 0b739f49743..f09d2f3fe51 100644 --- a/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceControllerTest.java @@ -193,7 +193,7 @@ public class AccessibilityHearingAidPreferenceControllerTest { private void setupBluetoothEnvironment() { ShadowBluetoothUtils.sLocalBluetoothManager = mLocalBluetoothManager; mLocalBluetoothManager = Utils.getLocalBtManager(mContext); - mBluetoothManager = new BluetoothManager(mContext); + mBluetoothManager = mContext.getSystemService(BluetoothManager.class); mBluetoothAdapter = mBluetoothManager.getAdapter(); when(mLocalBluetoothManager.getCachedDeviceManager()).thenReturn(mCachedDeviceManager); when(mLocalBluetoothManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager); diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java index 6ecbf2edc9f..08f708440fa 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsControllerTestBase.java @@ -76,7 +76,7 @@ public abstract class BluetoothDetailsControllerTestBase { when(mFragment.getPreferenceScreen()).thenReturn(mScreen); mLifecycleOwner = () -> mLifecycle; mLifecycle = spy(new Lifecycle(mLifecycleOwner)); - mBluetoothManager = new BluetoothManager(mContext); + mBluetoothManager = mContext.getSystemService(BluetoothManager.class); mBluetoothAdapter = mBluetoothManager.getAdapter(); } diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingControllerTest.java index 6da9bf471f7..88e15ebc13e 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothPairingControllerTest.java @@ -24,6 +24,7 @@ import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.content.Context; import android.content.Intent; +import android.os.Parcel; import com.android.settings.testutils.shadow.ShadowBluetoothAdapter; @@ -40,12 +41,22 @@ import org.robolectric.annotation.Config; @Config(shadows = {ShadowBluetoothAdapter.class}) public class BluetoothPairingControllerTest { private final BluetoothClass mBluetoothClass = - new BluetoothClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); + createBtClass(BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE); @Mock private BluetoothDevice mBluetoothDevice; private Context mContext; private BluetoothPairingController mBluetoothPairingController; + private BluetoothClass createBtClass(int deviceClass) { + Parcel p = Parcel.obtain(); + p.writeInt(deviceClass); + p.setDataPosition(0); // reset position of parcel before passing to constructor + + BluetoothClass bluetoothClass = BluetoothClass.CREATOR.createFromParcel(p); + p.recycle(); + return bluetoothClass; + } + @Before public void setUp() { MockitoAnnotations.initMocks(this); diff --git a/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java index 9c916028c1e..c80a951e23d 100644 --- a/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java @@ -137,7 +137,7 @@ public class AudioOutputSwitchPreferenceControllerTest { mPackageManager = Shadow.extract(mContext.getPackageManager()); mPackageManager.setSystemFeature(PackageManager.FEATURE_BLUETOOTH, true); - mBluetoothManager = new BluetoothManager(mContext); + mBluetoothManager = mContext.getSystemService(BluetoothManager.class); mBluetoothAdapter = mBluetoothManager.getAdapter(); mBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_1)); diff --git a/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java index fec70dc096b..8bf0deb50f5 100644 --- a/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceControllerTest.java @@ -129,7 +129,7 @@ public class HandsFreeProfileOutputPreferenceControllerTest { when(mLocalBluetoothProfileManager.getHeadsetProfile()).thenReturn(mHeadsetProfile); when(mLocalBluetoothProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); - mBluetoothManager = new BluetoothManager(mContext); + mBluetoothManager = mContext.getSystemService(BluetoothManager.class); mBluetoothAdapter = mBluetoothManager.getAdapter(); mBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_1)); diff --git a/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java index f604193debc..5d7c364c92e 100644 --- a/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/sound/MediaOutputPreferenceControllerTest.java @@ -170,7 +170,7 @@ public class MediaOutputPreferenceControllerTest { when(mLocalBluetoothProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile); when(mLocalBluetoothProfileManager.getHearingAidProfile()).thenReturn(mHearingAidProfile); - mBluetoothManager = new BluetoothManager(mContext); + mBluetoothManager = mContext.getSystemService(BluetoothManager.class); mBluetoothAdapter = mBluetoothManager.getAdapter(); mBluetoothDevice = spy(mBluetoothAdapter.getRemoteDevice(TEST_DEVICE_ADDRESS_1)); From 40af6d61fdb5b685a994f7eb0a3b11700dd9630d Mon Sep 17 00:00:00 2001 From: Silin Huang Date: Wed, 16 Feb 2022 12:19:08 -0800 Subject: [PATCH 4/4] Update the show wallet settings description label. Bug: 219635505 Test: manual Change-Id: I65704c196066df3b3a8bd348a81726c559bdae93 --- res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 6f86803feca..74586d43dee 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -13332,7 +13332,7 @@ Show wallet - Allow access to wallet from lock screen and quick settings + Allow access to wallet from lock screen Show QR scanner