Reputation: 23
i know that the question was asked before, and i did read all the solutions, but my case is kinda strange, i keep getting on Crash report on developer account the following:
java.lang.RuntimeException: at android.hardware.Camera.native_setParameters(Native Method:0) at android.hardware.Camera.setParameters(Camera.java:2080) at com.xxxxxxxxxx.core.xxxxxxxx.xxxxxxx.surfaceCreated(BackgroundVideoRecorder.java:119) at android.view.SurfaceView.updateWindow(SurfaceView.java:675) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:185) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2050) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1117) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6175) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:773) at android.view.Choreographer.doCallbacks(Choreographer.java:586) at android.view.Choreographer.doFrame(Choreographer.java:556) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:759) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5421) at java.lang.reflect.Method.invoke(Native Method:0) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Removed the application name for the sake of advertising, i tried the application on multiple devices and i cannot arrive to reproduce the error, even tho the devices that i tried it are available in the crash report, and in my parameter generation process i made sure to check if every parameter is supported, by checking the camera params here the code bellow:
if (front) {
params = camera.getParameters();
params.setRotation(90);
List<String> focusModes = params.getSupportedFocusModes();
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
Log.w("VideoTakerFront","Continuous Video Supported");
}
} else {
params = camera.getParameters();
params.setRotation(270);
List<String> focusModes = params.getSupportedFocusModes();
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
Log.w("VideoTakerBack","Continuous Video Supported");
}
}
camera.setParameters(params);
if (android.os.Build.VERSION.SDK_INT>=android.os.Build.VERSION_CODES.JELLY_BEAN_MR1){
camera.enableShutterSound(false);
}
else{
AudioManager audio= (AudioManager)this.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
audio.setStreamVolume(AudioManager.STREAM_SYSTEM, 0, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);
}
Log.w("VideoTaker", "Open Camera");
Thank you for the help!
Upvotes: 0
Views: 383
Reputation: 23
i found the problem... The users that reported the issue was using an older version of the application, i did not pay attention for the version, this problem used to happen in an older version, before I didn't use to get supported focus mode and check if it is available, thank you!
Upvotes: 1