Add property for redacting EXIF model and maker name
Redacting EXIF to be aligned with camera HAL when the property is true.
Bug: 242039712
Test: AOSP camera
Change-Id: I712cdec0bcfe02739e9a70bb06e84abe7bbecc17
diff --git a/Android.bp b/Android.bp
index a3cad58..5cf37d5 100644
--- a/Android.bp
+++ b/Android.bp
@@ -44,7 +44,7 @@
"20002000",
],
- sdk_version: "current",
+ sdk_version: "system_current",
product_specific: true,
diff --git a/src/com/android/camera/debug/DebugPropertyHelper.java b/src/com/android/camera/debug/DebugPropertyHelper.java
index 66ccaaf..85c0955 100644
--- a/src/com/android/camera/debug/DebugPropertyHelper.java
+++ b/src/com/android/camera/debug/DebugPropertyHelper.java
@@ -16,7 +16,7 @@
package com.android.camera.debug;
-import com.android.camera.util.SystemProperties;
+import android.os.SystemProperties;
public class DebugPropertyHelper {
private static final String OFF_VALUE = "0";
@@ -38,6 +38,8 @@
private static final String PROP_WRITE_CAPTURE_DATA = PREFIX + ".capture_write";
/** Is RAW support enabled. */
private static final String PROP_CAPTURE_DNG = PREFIX + ".capture_dng";
+ /** Redacting EXIF manufacturer and model name. */
+ private static final String PROP_REDACT_EXIF = PREFIX + ".redact_exif";
private static boolean isPropertyOn(String property) {
return ON_VALUE.equals(SystemProperties.get(property, OFF_VALUE));
@@ -58,4 +60,8 @@
public static boolean isCaptureDngEnabled() {
return isPropertyOn(PROP_CAPTURE_DNG);
}
+
+ public static boolean isRedactExifEnabled() {
+ return isPropertyOn(PROP_REDACT_EXIF);
+ }
}
diff --git a/src/com/android/camera/util/ExifUtil.java b/src/com/android/camera/util/ExifUtil.java
index 18150a0..5fae249 100644
--- a/src/com/android/camera/util/ExifUtil.java
+++ b/src/com/android/camera/util/ExifUtil.java
@@ -20,6 +20,7 @@
import android.location.Location;
import android.os.Build;
+import com.android.camera.debug.DebugPropertyHelper;
import com.android.camera.exif.ExifInterface;
import com.android.camera.exif.Rational;
import com.android.camera.one.v2.camera2proxy.CaptureResultProxy;
@@ -113,8 +114,13 @@
}
private void addMakeAndModelToExif() {
- addExifTag(ExifInterface.TAG_MAKE, Build.MANUFACTURER);
- addExifTag(ExifInterface.TAG_MODEL, Build.MODEL);
+ if (DebugPropertyHelper.isRedactExifEnabled()) {
+ addExifTag(ExifInterface.TAG_MAKE, "CAM_YY");
+ addExifTag(ExifInterface.TAG_MODEL, "CAM_XX");
+ } else {
+ addExifTag(ExifInterface.TAG_MAKE, Build.MANUFACTURER);
+ addExifTag(ExifInterface.TAG_MODEL, Build.MODEL);
+ }
}
private void addImageDataToExif(TaskImageContainer.TaskImage image) {