Decouple the visibility check for system UI from action bar

And make sure we toggle system UI when reload.

bug:11539377

Change-Id: I4d251557c1d68a173cabb652e0beaa3ee89cb6f0
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 86f1de5..3a5ddb6 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -339,6 +339,7 @@
                 @Override
                 public void onReload() {
                     setPreviewControlsVisibility(true);
+                    CameraActivity.this.setSystemBarsVisibility(false);
                 }
 
                 @Override
@@ -466,13 +467,17 @@
      */
     private void setSystemBarsVisibility(boolean visible, boolean hideLater) {
         mMainHandler.removeMessages(HIDE_ACTION_BAR);
-        boolean currentlyVisible = mActionBar.isShowing();
 
-        if (visible != currentlyVisible) {
-            int visibility = DEFAULT_SYSTEM_UI_VISIBILITY | (visible ? View.SYSTEM_UI_FLAG_VISIBLE
-                    : View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN);
-            mAboveFilmstripControlLayout.setSystemUiVisibility(visibility);
+        int currentSystemUIVisibility = mAboveFilmstripControlLayout.getSystemUiVisibility();
+        int newSystemUIVisibility = DEFAULT_SYSTEM_UI_VISIBILITY |
+                (visible ? View.SYSTEM_UI_FLAG_VISIBLE :
+                        View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN);
+        if (newSystemUIVisibility != currentSystemUIVisibility) {
+            mAboveFilmstripControlLayout.setSystemUiVisibility(newSystemUIVisibility);
+        }
 
+        boolean currentActionBarVisibility = mActionBar.isShowing();
+        if (visible != currentActionBarVisibility) {
             if (visible) {
                 mActionBar.show();
             } else {