Revert "Update brightness percentage display logic to match sysui."

This reverts commit 1346b066bde27e89f876eca6ada31c63d8ea29d0.

Reason for revert: Broke qt-release.

Change-Id: I0b534dee83266f78c4ba8fb119e27754fdac9117
(cherry picked from commit 8194ebf35fa23ad33175706efc99182f07d31b25)
diff --git a/src/com/android/settings/display/BrightnessLevelPreferenceController.java b/src/com/android/settings/display/BrightnessLevelPreferenceController.java
index be79f66..e0aeda1 100644
--- a/src/com/android/settings/display/BrightnessLevelPreferenceController.java
+++ b/src/com/android/settings/display/BrightnessLevelPreferenceController.java
@@ -13,9 +13,6 @@
  */
 package com.android.settings.display;
 
-import static com.android.settingslib.display.BrightnessUtils.GAMMA_SPACE_MAX;
-import static com.android.settingslib.display.BrightnessUtils.convertLinearToGamma;
-
 import android.content.ContentResolver;
 import android.content.Context;
 import android.database.ContentObserver;
@@ -66,12 +63,12 @@
     }
 
     private ContentObserver mBrightnessObserver =
-            new ContentObserver(new Handler(Looper.getMainLooper())) {
-                @Override
-                public void onChange(boolean selfChange) {
-                    updatedSummary(mPreference);
-                }
-            };
+        new ContentObserver(new Handler(Looper.getMainLooper())) {
+            @Override
+            public void onChange(boolean selfChange) {
+                updatedSummary(mPreference);
+            }
+        };
 
     public BrightnessLevelPreferenceController(Context context, Lifecycle lifecycle) {
         super(context);
@@ -106,7 +103,6 @@
     public void updateState(Preference preference) {
         updatedSummary(preference);
     }
-
     @Override
     public void onStart() {
         mContentResolver.registerContentObserver(BRIGHTNESS_URI, false, mBrightnessObserver);
@@ -126,18 +122,15 @@
     }
 
     private double getCurrentBrightness() {
-        final int value;
         if (isInVrMode()) {
-            value = convertLinearToGamma(System.getInt(mContentResolver,
-                    System.SCREEN_BRIGHTNESS_FOR_VR, mMaxBrightness),
-                    mMinVrBrightness, mMaxVrBrightness);
+            final double value = System.getInt(mContentResolver, System.SCREEN_BRIGHTNESS_FOR_VR,
+                    mMaxBrightness);
+            return getPercentage(value, mMinVrBrightness, mMaxVrBrightness);
         } else {
-            value = convertLinearToGamma(Settings.System.getInt(mContentResolver,
-                    System.SCREEN_BRIGHTNESS, mMinBrightness),
-                    mMinBrightness, mMaxBrightness);
-
+            final double value = Settings.System.getInt(mContentResolver, System.SCREEN_BRIGHTNESS,
+                    mMinBrightness);
+            return getPercentage(value, mMinBrightness, mMaxBrightness);
         }
-        return getPercentage(value, 0, GAMMA_SPACE_MAX);
     }
 
     private double getPercentage(double value, int min, int max) {
diff --git a/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java
index b758531..8980a50 100644
--- a/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/display/BrightnessLevelPreferenceControllerTest.java
@@ -122,7 +122,7 @@
 
         mController.updateState(mPreference);
 
-        verify(mPreference).setSummary("97%");
+        verify(mPreference).setSummary("85%");
     }
 
     @Test
@@ -135,7 +135,7 @@
 
         mController.updateState(mPreference);
 
-        verify(mPreference).setSummary("78%");
+        verify(mPreference).setSummary("31%");
     }
 
     @Test
@@ -148,7 +148,7 @@
 
         mController.updateState(mPreference);
 
-        verify(mPreference).setSummary("85%");
+        verify(mPreference).setSummary("45%");
     }
 
     @Test