SettingsManager: fix QCFA crash
-----
02-22 14:17:18.636 9150 9150 E AndroidRuntime: FATAL EXCEPTION: main
02-22 14:17:18.636 9150 9150 E AndroidRuntime: Process: org.codeaurora.snapcam, PID: 9150
02-22 14:17:18.636 9150 9150 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {org.codeaurora.snapcam/com.android.camera.CameraActivity}: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4206)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4238)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7397)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at java.lang.String.substring(String.java:2064)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at com.android.camera.SettingsManager.parseSize(SettingsManager.java:539)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at com.android.camera.SettingsManager.getQcfaSupportSize(SettingsManager.java:2191)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at com.android.camera.CaptureModule.openProcessors(CaptureModule.java:3625)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at com.android.camera.CaptureModule.onResumeAfterSuper(CaptureModule.java:3698)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at com.android.camera.CameraActivity.onResume(CameraActivity.java:1904)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1454)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.Activity.performResume(Activity.java:7958)
02-22 14:17:18.636 9150 9150 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4196)
-----
Change-Id: I213857feef5d32c0110dbd928aa81a91f5df0dda
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
1 file changed