Settings: Show HAL HDR+ option in user build am: 4d26fa03a8

am: f0c328ed78

Change-Id: Ia14d7a5ada922d29816f8c9d2895f6141d86ff27
This commit is contained in:
Chien-Yu Chen
2017-09-27 23:35:18 +00:00
committed by android-build-merger
2 changed files with 1 additions and 38 deletions

View File

@@ -67,9 +67,7 @@ public class CameraHalHdrplusPreferenceController extends AbstractPreferenceCont
@Override @Override
public boolean isAvailable() { public boolean isAvailable() {
return mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus) && return mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus);
(SystemProperties.get(BUILD_TYPE).equals("userdebug") ||
SystemProperties.get(BUILD_TYPE).equals("eng"));
} }
@Override @Override

View File

@@ -57,8 +57,6 @@ public class CameraHalHdrplusPreferenceControllerTest {
private SwitchPreference mPreference; private SwitchPreference mPreference;
static final String USERDEBUG_BUILD = "userdebug"; static final String USERDEBUG_BUILD = "userdebug";
static final String ENG_BUILD = "eng";
static final String USER_BUILD = "user";
private CameraHalHdrplusPreferenceController mController; private CameraHalHdrplusPreferenceController mController;
@@ -82,39 +80,6 @@ public class CameraHalHdrplusPreferenceControllerTest {
assertThat(mController.isAvailable()).isFalse(); assertThat(mController.isAvailable()).isFalse();
} }
@Test
public void isAvailable_withUserdebugBuild_shouldReturnTrue() {
when(mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus))
.thenReturn(true);
SettingsShadowSystemProperties.set(
CameraHalHdrplusPreferenceController.BUILD_TYPE, USERDEBUG_BUILD);
assertThat(mController.isAvailable()).isTrue();
}
@Test
public void isAvailable_withEngBuild_shouldReturnTrue() {
when(mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus))
.thenReturn(true);
SettingsShadowSystemProperties.set(
CameraHalHdrplusPreferenceController.BUILD_TYPE, ENG_BUILD);
assertThat(mController.isAvailable()).isTrue();
}
@Test
public void isAvailable_withUserBuild_shouldReturnFalse() {
when(mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus))
.thenReturn(true);
SettingsShadowSystemProperties.set(
CameraHalHdrplusPreferenceController.BUILD_TYPE, USER_BUILD);
assertThat(mController.isAvailable()).isFalse();
}
@Test @Test
public void displayPreference_cameraHalHdrplusEnabled_shouldCheckedPreference() { public void displayPreference_cameraHalHdrplusEnabled_shouldCheckedPreference() {
when(mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus)) when(mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus))