summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-10-14 12:25:08 -0700
committerMichael Bestas <mikeioannina@gmail.com>2015-09-17 23:26:01 +0300
commitb9347d9cf727fa14f9b44adb43e0db60fbe32d8d (patch)
treea5b3c59e0b135a51d4c7656d3a1bb17258c88f79 /src/com/android/camera/util
parentd2a585416a19a3a4a9552333d8aa41c36862d903 (diff)
downloadandroid_packages_apps_Snap-b9347d9cf727fa14f9b44adb43e0db60fbe32d8d.tar.gz
android_packages_apps_Snap-b9347d9cf727fa14f9b44adb43e0db60fbe32d8d.tar.bz2
android_packages_apps_Snap-b9347d9cf727fa14f9b44adb43e0db60fbe32d8d.zip
camera: Add parameter debugging support
Change-Id: Ifc1653f0046af169ba36d94796b4d9a3055c6798
Diffstat (limited to 'src/com/android/camera/util')
-rw-r--r--src/com/android/camera/util/CameraUtil.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 1217cde64..8017849fc 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -65,10 +65,14 @@ import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
+import java.util.Arrays;
import java.util.Date;
+import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.Set;
import java.util.StringTokenizer;
+import java.util.TreeSet;
/**
* Collection of utility functions used in this package.
@@ -605,13 +609,25 @@ public class CameraUtil {
return optimalSize;
}
- public static void dumpParameters(Parameters parameters) {
- String flattened = parameters.flatten();
- StringTokenizer tokenizer = new StringTokenizer(flattened, ";");
- Log.d(TAG, "Dump all camera parameters:");
- while (tokenizer.hasMoreElements()) {
- Log.d(TAG, tokenizer.nextToken());
+ public static void dumpParameters(Parameters params) {
+ Set<String> sortedParams = new TreeSet<String>();
+ sortedParams.addAll(Arrays.asList(params.flatten().split(";")));
+ StringBuilder sb = new StringBuilder();
+ sb.append("[");
+ Iterator<String> i = sortedParams.iterator();
+ while (i.hasNext()) {
+ String nextParam = i.next();
+ if ((sb.length() + nextParam.length()) > 2044) {
+ Log.d(TAG, "Parameters: " + sb.toString());
+ sb = new StringBuilder();
+ }
+ sb.append(nextParam);
+ if (i.hasNext()) {
+ sb.append(", ");
+ }
}
+ sb.append("]");
+ Log.d(TAG, "Parameters: " + sb.toString());
}
/**