Camera2 API を使用してアプリを開発しています。私の問題は次のようになります。カメラ フラグメントが動作しているときにデバイスのスリープ ボタンを押した後、デバイスを起動すると、アプリケーションが再起動します。
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: FATAL EXCEPTION: main
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: Process: com.snapsportz.nexus5camera.app, PID: 5081
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: java.lang.RuntimeException: Unable to pause activity {com.snapsportz.nexus5camera.app/com.snapsportz.handheldcamera.app.CameraActivity}: java.lang.SecurityException: Lacking privileges to access camera service
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3381)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3340)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4047)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.-wrap15(ActivityThread.java)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: Caused by: java.lang.SecurityException: Lacking privileges to access camera service
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.hardware.camera2.utils.CameraBinderDecorator.throwOnError(CameraBinderDecorator.java:108)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.hardware.camera2.utils.CameraBinderDecorator$CameraBinderDecoratorListener.onAfterInvocation(CameraBinderDecorator.java:73)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.hardware.camera2.utils.Decorator.invoke(Decorator.java:81)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at java.lang.reflect.Proxy.invoke(Proxy.java:393)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at $Proxy1.cancelRequest(Unknown Source)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:899)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:373)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at com.snapsportz.handheldcamera.app.Camera2BasicFragment.closeCamera(Camera2BasicFragment.java:899)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at com.snapsportz.handheldcamera.app.Camera2BasicFragment.onPause(Camera2BasicFragment.java:771)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.Fragment.performPause(Fragment.java:2379)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1019)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1130)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.FragmentManagerImpl.dispatchPause(FragmentManager.java:1967)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.FragmentController.dispatchPause(FragmentController.java:185)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.Activity.performPause(Activity.java:6346)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1311)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3367)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3340)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4047)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.-wrap15(ActivityThread.java)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5417)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
12-10 10:59:10.423 5081-5081/com.snapsportz.nexus5camera.app E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
マニフェスト ファイルにカメラのアクセス許可が含まれていないため、カメラのアクセス許可が不足しているとは考えていません。
どんなヒントでも本当にうれしいです。