StringIndexOutOfBoundsException on Camera.Parameters.flatten() with DroidX
<p>I gotten a few very odd error reports from users recently showing a StringIndexOutOfBoundsException when I called Camera.Parameters.flatten().</p>

<p>I suppose the params object I had might have been null, and I dont check that before calling flatten, but I would have expected an NPE.</p>

<p>Has anyone else seen anything similar? I havent heard back from the user whether this was one time or every time and am starting to wonder how common this is with DroidX running 2.2.</p>

<pre><code>EXTRA INFO:
Error setting cam params. Current op was:
Setting camera orientation
Op trace: Starting op: Setting camera orientation

App Version: Version 1.02 - build 31
------------------------------------------------
DEVICE INFO:
Device: cdma_shadow
Manufacturer: motorola
Model: DROIDX
OS Version release: 2.2
------------------------------------------------
STACK TRACE
mobi.sense8.android.util.camera.CameraHelperException
at java.lang.AbstractStringBuilder.deleteCharAt0(AbstractStringBuilder.java:257)
at java.lang.StringBuilder.deleteCharAt(StringBuilder.java:360)
at android.hardware.Camera$Parameters.flatten(Camera.java:945)
at mobi.sense8.android.util.camera.CameraHelper.setOrientation(CameraHelper.java:120)
at mobi.sense8.android.iSnipeYou.iSnipeYou.initCameraNew(iSnipeYou.java:650)
at mobi.sense8.android.iSnipeYou.iSnipeYou.surfaceChanged(iSnipeYou.java:630)
at android.view.SurfaceView.updateWindow(SurfaceView.java:538)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:206)
at android.view.View.dispatchWindowVisibilityChanged(View.java:3891)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:719)
at android.view.ViewRoot.performTraversals(ViewRoot.java:753)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1736)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
... 22 more
</code></pre>
