OSDN Git Service

Settings: Show HAL HDR+ option in user build
authorChien-Yu Chen <cychen@google.com>
Wed, 27 Sep 2017 18:38:15 +0000 (11:38 -0700)
committerChien-Yu Chen <cychen@google.com>
Wed, 27 Sep 2017 21:03:12 +0000 (14:03 -0700)
Test: CameraHalHdrplusPreferenceControllerTest
Bug: 66919557
Change-Id: I02e89d34db56398e64e12616f34b8584df25c48b

src/com/android/settings/development/CameraHalHdrplusPreferenceController.java
tests/robotests/src/com/android/settings/development/CameraHalHdrplusPreferenceControllerTest.java

index e8e2c2d..84836bc 100644 (file)
@@ -63,9 +63,7 @@ public class CameraHalHdrplusPreferenceController extends AbstractPreferenceCont
 
     @Override
     public boolean isAvailable() {
-        return mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus) &&
-               (SystemProperties.get(BUILD_TYPE).equals("userdebug") ||
-                SystemProperties.get(BUILD_TYPE).equals("eng"));
+        return mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus);
     }
 
     @Override
index d218434..f5ef38f 100644 (file)
@@ -53,8 +53,6 @@ public class CameraHalHdrplusPreferenceControllerTest {
     private SwitchPreference mPreference;
 
     static final String USERDEBUG_BUILD = "userdebug";
-    static final String ENG_BUILD = "eng";
-    static final String USER_BUILD = "user";
 
     private CameraHalHdrplusPreferenceController mController;
 
@@ -79,39 +77,6 @@ public class CameraHalHdrplusPreferenceControllerTest {
     }
 
     @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
     public void displayPreference_cameraHalHdrplusEnabled_shouldCheckedPreference() {
         when(mContext.getResources().getBoolean(R.bool.config_show_camera_hal_hdrplus))
                 .thenReturn(true);