Merge "Click the search result "System Sounds" will crash the Settings app" into udc-dev
This commit is contained in:
@@ -33,10 +33,8 @@ import com.android.settings.search.BaseSearchIndexProvider;
|
|||||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||||
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
|
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
|
||||||
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||||
import com.android.settingslib.search.SearchIndexable;
|
|
||||||
|
|
||||||
/** Settings fragment containing bluetooth audio routing. */
|
/** Settings fragment containing bluetooth audio routing. */
|
||||||
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
|
|
||||||
public class BluetoothDetailsAudioRoutingFragment extends RestrictedDashboardFragment {
|
public class BluetoothDetailsAudioRoutingFragment extends RestrictedDashboardFragment {
|
||||||
|
|
||||||
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
|
||||||
|
@@ -26,8 +26,6 @@ import android.os.Bundle;
|
|||||||
|
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
|
|
||||||
import com.android.settings.R;
|
|
||||||
import com.android.settings.testutils.XmlTestUtils;
|
|
||||||
import com.android.settings.testutils.shadow.ShadowBluetoothUtils;
|
import com.android.settings.testutils.shadow.ShadowBluetoothUtils;
|
||||||
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
|
||||||
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
|
import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
|
||||||
@@ -44,8 +42,6 @@ import org.mockito.junit.MockitoRule;
|
|||||||
import org.robolectric.RobolectricTestRunner;
|
import org.robolectric.RobolectricTestRunner;
|
||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/** Tests for {@link BluetoothDetailsAudioRoutingFragment}. */
|
/** Tests for {@link BluetoothDetailsAudioRoutingFragment}. */
|
||||||
@RunWith(RobolectricTestRunner.class)
|
@RunWith(RobolectricTestRunner.class)
|
||||||
@Config(shadows = {ShadowBluetoothUtils.class})
|
@Config(shadows = {ShadowBluetoothUtils.class})
|
||||||
@@ -92,17 +88,6 @@ public class BluetoothDetailsAudioRoutingFragmentTest {
|
|||||||
assertThat(mFragment.mCachedDevice.getAddress()).isEqualTo(TEST_ADDRESS);
|
assertThat(mFragment.mCachedDevice.getAddress()).isEqualTo(TEST_ADDRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void getNonIndexableKeys_existInXmlLayout() {
|
|
||||||
final List<String> niks = BluetoothDetailsAudioRoutingFragment.SEARCH_INDEX_DATA_PROVIDER
|
|
||||||
.getNonIndexableKeys(mContext);
|
|
||||||
final List<String> keys =
|
|
||||||
XmlTestUtils.getKeysFromPreferenceXml(mContext,
|
|
||||||
R.xml.bluetooth_audio_routing_fragment);
|
|
||||||
|
|
||||||
assertThat(keys).containsAtLeastElementsIn(niks);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupEnvironment() {
|
private void setupEnvironment() {
|
||||||
ShadowBluetoothUtils.sLocalBluetoothManager = mLocalBluetoothManager;
|
ShadowBluetoothUtils.sLocalBluetoothManager = mLocalBluetoothManager;
|
||||||
when(mLocalBluetoothManager.getCachedDeviceManager()).thenReturn(mCachedDeviceManager);
|
when(mLocalBluetoothManager.getCachedDeviceManager()).thenReturn(mCachedDeviceManager);
|
||||||
|
Reference in New Issue
Block a user