Add a boolean flag to show or hide the device name in About device.
The following boolean flag is added: config_show_device_name When set to false, the device name will not be shown in System > About Device. Bug: 111653180 Test: Updated robotests Change-Id: Id9610e2009604c9d9693428adff01adc7d606565
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.deviceinfo;
|
||||
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
@@ -41,6 +43,7 @@ import org.mockito.Answers;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.annotation.Config;
|
||||
import org.robolectric.shadows.ShadowApplication;
|
||||
|
||||
import androidx.preference.PreferenceScreen;
|
||||
@@ -79,6 +82,17 @@ public class DeviceNamePreferenceControllerTest {
|
||||
mController.setLocalBluetoothManager(mBluetoothManager);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailibilityStatus_availableByDefault() {
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(qualifiers = "mcc999")
|
||||
public void getAvailabilityStatus_unsupportedWhenSet() {
|
||||
assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void constructor_defaultDeviceNameIsModelName() {
|
||||
assertThat(mController.getSummary()).isEqualTo(Build.MODEL);
|
||||
|
Reference in New Issue
Block a user