Update location indicator correctly

  Bug: 8768592

Change-Id: I8f94b4fb62174c4c27e6dbdc68ba272b0d3ae371
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index e2b7819..0949104 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -306,16 +306,11 @@
             wbIndex = pref.getCurrentIndex();
         }
         mOnScreenIndicators.updateWBIndicator(wbIndex);
-        boolean location = false;
-        pref = group.findPreference(CameraSettings.KEY_RECORD_LOCATION);
-        if (pref != null) {
-            location = !(pref.getCurrentIndex() == 0);
-        }
+        boolean location = RecordLocationPreference.get(
+                prefs, mActivity.getContentResolver());
         mOnScreenIndicators.updateLocationIndicator(location);
     }
 
-
-
     public void setCameraState(int state) {
     }
 
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 54d9f36..0bcdbab 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -417,7 +417,7 @@
 
         initializeVideoControl();
         mPendingSwitchCameraId = -1;
-        mUI.updateOnScreenIndicators(mParameters);
+        mUI.updateOnScreenIndicators(mParameters, mPreferences);
 
         // Disable the shutter button if effects are ON since it might take
         // a little more time for the effects preview to be ready. We do not
@@ -2008,7 +2008,7 @@
             } else {
                 setCameraParameters();
             }
-            mUI.updateOnScreenIndicators(mParameters);
+            mUI.updateOnScreenIndicators(mParameters, mPreferences);
         }
     }
 
@@ -2046,7 +2046,7 @@
             // onFrameAvailable from the old camera may already exist.
             mHandler.sendEmptyMessage(SWITCH_CAMERA_START_ANIMATION);
         }
-        mUI.updateOnScreenIndicators(mParameters);
+        mUI.updateOnScreenIndicators(mParameters, mPreferences);
     }
 
     // Preview texture has been copied. Now camera can be released and the
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index e55de9e..0afcd8a 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -251,8 +251,12 @@
         mLabelsLinearLayout = (LinearLayout) mRootView.findViewById(R.id.labels);
     }
 
-    public void updateOnScreenIndicators(Parameters param) {
+    public void updateOnScreenIndicators(Parameters param, ComboPreferences prefs) {
       mOnScreenIndicators.updateFlashOnScreenIndicator(param.getFlashMode());
+      boolean location = RecordLocationPreference.get(
+              prefs, mActivity.getContentResolver());
+      mOnScreenIndicators.updateLocationIndicator(location);
+
     }
 
     public void setAspectRatio(double ratio) {