summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r--src/com/android/camera/CameraActivity.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index bbe0ebb08..b27c44827 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -232,13 +232,29 @@ public class CameraActivity extends Activity
@Override
public void onDataFullScreenChange(int dataID, boolean full) {
- boolean isCameraID = mDataAdapter.getLocalData(dataID).getLocalDataType() ==
- LocalData.LOCAL_CAMERA_PREVIEW;
+ boolean isCameraID = isCameraPreview(dataID);
if (!isCameraID) {
setActionBarVisibilityAndLightsOut(full);
}
}
+ /**
+ * Check if the local data corresponding to dataID is the camera
+ * preview.
+ *
+ * @param dataID the ID of the local data
+ * @return true if the local data is not null and it is the
+ * camera preview.
+ */
+ private boolean isCameraPreview(int dataID) {
+ LocalData localData = mDataAdapter.getLocalData(dataID);
+ if (localData == null) {
+ Log.w(TAG, "Current data ID not found.");
+ return false;
+ }
+ return localData.getLocalDataType() == LocalData.LOCAL_CAMERA_PREVIEW;
+ }
+
@Override
public void onCurrentDataChanged(final int dataID, final boolean current) {
runOnUiThread(new Runnable() {
@@ -286,13 +302,13 @@ public class CameraActivity extends Activity
}
@Override
- public boolean onToggleActionBarVisibility() {
+ public boolean onToggleActionBarVisibility(int dataID) {
if (mActionBar.isShowing()) {
setActionBarVisibilityAndLightsOut(true);
} else {
- // In the preview, don't show the action bar if that is
- // a capture intent.
- if (!isCaptureIntent()) {
+ // Don't show the action bar if that is the camera preview.
+ boolean isCameraID = isCameraPreview(dataID);
+ if (!isCameraID) {
setActionBarVisibilityAndLightsOut(false);
}
}