Closed beniroquai closed 3 years ago
write permission shouldnt needed with mediastore and >= api28
https://developer.android.com/training/data-storage/shared/media
thats also why freedcam nolonger ask for write permission.
happen it only with movies or images too?
seems to happen only on android 9
java.lang.SecurityException:
at android.os.Parcel.createException (Parcel.java:1950)
at android.os.Parcel.readException (Parcel.java:1918)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:135)
at android.content.ContentProviderProxy.insert (ContentProviderNative.java:476)
at android.content.ContentResolver.insert (ContentResolver.java:1587)
at freed.file.MediaStoreController.addImg (MediaStoreController.java:53)
at freed.file.FileListController.getNewImgFileHolder (FileListController.java:316)
at freed.image.ImageSaveTask.saveJpeg (ImageSaveTask.java:234)
at freed.image.ImageSaveTask.process (ImageSaveTask.java:172)
at freed.image.ImageTask.run (ImageTask.java:21)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:764)
Taking images (after recompiling from source and not setting permission manually) gives:
020-12-14 11:55:24.180 24091-24275/troop.com.freedcam E/AndroidRuntime: FATAL EXCEPTION: pool-3-thread-1
Process: troop.com.freedcam, PID: 24091
java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=24091, uid=10196 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.createException(Parcel.java:1953)
at android.os.Parcel.readException(Parcel.java:1921)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:476)
at android.content.ContentResolver.insert(ContentResolver.java:1611)
at freed.file.MediaStoreController.addImg(MediaStoreController.java:57)
at freed.file.FileListController.getNewImgFileHolder(FileListController.java:344)
at freed.image.ImageSaveTask.saveJpeg(ImageSaveTask.java:234)
at freed.image.ImageSaveTask.process(ImageSaveTask.java:172)
at freed.image.ImageTask.run(ImageTask.java:21)
at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:784)
2020-12-14 11:55:24.192 24091-24100/troop.com.freedcam W/System: A resource failed to call destroy.
2020-12-14 11:55:24.193 24091-24100/troop.com.freedcam D/BackgroundHandlerThread: stopBackgroundThreadCaptureSessionHandler
2020-12-14 11:55:24.194 24091-24100/troop.com.freedcam W/System: A resource failed to call release.
2020-12-14 11:55:24.194 24091-24100/troop.com.freedcam I/chatty: uid=10196(troop.com.freedcam) FinalizerDaemon expire 1 line
2020-12-14 11:55:24.194 24091-24100/troop.com.freedcam W/System: A resource failed to call release.
2020-12-14 11:55:24.220 24091-24091/troop.com.freedcam D/LocationManager: stop location
2020-12-14 11:55:24.224 24091-24275/troop.com.freedcam I/Process: Sending signal. PID: 24091 SIG: 9
After setting permission in settings, it creates the following output (no error, but also no picture):
2020-12-14 12:00:50.812 24494-24494/troop.com.freedcam V/AudioManager: playSoundEffect effectType: 0
2020-12-14 12:00:50.812 24494-24494/troop.com.freedcam V/AudioManager: querySoundEffectsEnabled...
2020-12-14 12:00:50.812 24494-24494/troop.com.freedcam D/PictureModuleApi2: startWork: start new progress
2020-12-14 12:00:50.813 24494-25071/troop.com.freedcam D/PictureModuleApi2: Jpeg
2020-12-14 12:00:50.813 24494-25071/troop.com.freedcam D/PictureModuleApi2: mState:STATE_WAIT_FOR_PRECAPTURE
2020-12-14 12:00:50.813 24494-25071/troop.com.freedcam D/CameraValuesChangedCaptureCallback: rest ae af lock
2020-12-14 12:00:50.813 24494-25071/troop.com.freedcam D/PictureModuleApi2: Start AE Precapture
2020-12-14 12:00:50.813 24494-25071/troop.com.freedcam D/CaptureSessionHandler: Set :android.control.aePrecaptureTrigger to 1
2020-12-14 12:00:50.813 24494-25071/troop.com.freedcam D/CaptureSessionHandler: Set :android.control.afTrigger to 1
2020-12-14 12:00:50.813 24494-25071/troop.com.freedcam D/CaptureSessionHandler: capture
2020-12-14 12:00:50.842 24494-25071/troop.com.freedcam D/CameraValuesChangedCaptureCallback: ae locked: true af locked: false 1188
2020-12-14 12:00:50.842 24494-25071/troop.com.freedcam D/PictureModuleApi2: ae locked: true af locked: false
2020-12-14 12:00:50.876 24494-25071/troop.com.freedcam D/CameraValuesChangedCaptureCallback: ae locked: true af locked: false 1188
2020-12-14 12:00:50.876 24494-25071/troop.com.freedcam D/PictureModuleApi2: ae locked: true af locked: false
2020-12-14 12:00:50.910 24494-25072/troop.com.freedcam D/CameraValuesChangedCaptureCallback: ae locked: true af locked: false 1189
2020-12-14 12:00:50.910 24494-25072/troop.com.freedcam D/PictureModuleApi2: ae locked: true af locked: false
2020-12-14 12:00:50.944 24494-25071/troop.com.freedcam D/CameraValuesChangedCaptureCallback: ae locked: true af locked: true 1188
2020-12-14 12:00:50.944 24494-25071/troop.com.freedcam D/PictureModuleApi2: ae locked: true af locked: true
2020-12-14 12:00:50.945 24494-25071/troop.com.freedcam D/CameraValuesChangedCaptureCallback: clear wait for ae af lock
2020-12-14 12:00:50.945 24494-25071/troop.com.freedcam D/PictureModuleApi2: mState:STATE_PICTURE_TAKEN
2020-12-14 12:00:50.945 24494-25071/troop.com.freedcam D/PictureModuleApi2: ########### captureStillPicture ###########
2020-12-14 12:00:50.948 24494-25071/troop.com.freedcam D/CaptureSessionHandler: Set :android.jpeg.orientation to 90
2020-12-14 12:00:50.948 24494-25071/troop.com.freedcam D/ModuleAbstract: work started
2020-12-14 12:00:50.948 24494-25071/troop.com.freedcam D/ShutterButton: switchBackground:image_capture_start
2020-12-14 12:00:50.948 24494-25071/troop.com.freedcam D/PictureModuleApi2: StartStillCapture
2020-12-14 12:00:50.949 24494-25071/troop.com.freedcam D/CaptureSessionHandler: StopRepeatingCaptureSession
2020-12-14 12:00:50.949 24494-25071/troop.com.freedcam D/CaptureSessionHandler: StartImageCapture
2020-12-14 12:00:51.066 24494-25071/troop.com.freedcam D/CaptureController: onCaptureCompleted FrameNum:1220
2020-12-14 12:00:51.067 24494-25071/troop.com.freedcam D/AbstractImageCapture: setCaptureResult
2020-12-14 12:00:51.067 24494-25071/troop.com.freedcam D/AbstractImageCapture: Task is null wait
2020-12-14 12:00:51.314 24494-25076/troop.com.freedcam D/JpegCapture: onImageAvailable forward to super
2020-12-14 12:00:51.314 24494-25076/troop.com.freedcam D/AbstractImageCapture: onImageAvailable
2020-12-14 12:00:51.315 24494-25076/troop.com.freedcam D/ByteImageCapture: Create JPEG
2020-12-14 12:00:51.315 24494-24634/troop.com.freedcam I/CameraDevice-JV-0: Camera now idle
2020-12-14 12:00:51.315 24494-25072/troop.com.freedcam D/CaptureSessionHandler: onReady()
2020-12-14 12:00:51.322 24494-25076/troop.com.freedcam D/AbstractImageCapture: Add new img to queue
2020-12-14 12:00:51.325 24494-25071/troop.com.freedcam D/CaptureController: Put task to Queue
2020-12-14 12:00:51.325 24494-25071/troop.com.freedcam D/PictureModuleApi2: onRdyToSaveImg
2020-12-14 12:00:51.325 24494-25071/troop.com.freedcam D/ModuleAbstract: work started
2020-12-14 12:00:51.325 24494-25071/troop.com.freedcam D/ShutterButton: switchBackground:image_capture_stop
2020-12-14 12:00:51.325 24494-25071/troop.com.freedcam D/PictureModuleApi2: finished Capture:1isBurst:false
2020-12-14 12:00:51.325 24494-25071/troop.com.freedcam D/PictureModuleApi2: onSessionRdy() ######################### Rdy to Start Preview, CAPTURE CYCLE DONE #####################
2020-12-14 12:00:51.326 24494-25071/troop.com.freedcam D/CaptureSessionHandler: Set :android.control.afTrigger to 2
2020-12-14 12:00:51.328 24494-25219/troop.com.freedcam D/ImageSaveTask: saveJpeg
2020-12-14 12:00:51.328 24494-25219/troop.com.freedcam D/ImageSaveTask: Start Saving Bytes
2020-12-14 12:00:51.329 24494-25071/troop.com.freedcam D/CaptureSessionHandler: Set :android.control.afTrigger to 0
2020-12-14 12:00:51.330 24494-25071/troop.com.freedcam D/CaptureSessionHandler: StartRepeatingCaptureSession Surface:2
2020-12-14 12:00:51.335 24494-25072/troop.com.freedcam D/CaptureSessionHandler: onActive()
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: java.io.FileNotFoundException: Can't access /2020_12_14_12_00_50.jpg
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:144)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:625)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1331)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentResolver.openOutputStream(ContentResolver.java:1073)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentResolver.openOutputStream(ContentResolver.java:1049)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.file.holder.UriHolder.getOutputStream(UriHolder.java:108)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.image.ImageSaveTask.saveJpeg(ImageSaveTask.java:236)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.image.ImageSaveTask.process(ImageSaveTask.java:172)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.image.ImageTask.run(ImageTask.java:21)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
2020-12-14 12:00:51.354 24494-25219/troop.com.freedcam W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2020-12-14 12:00:51.354 24494-25219/troop.com.freedcam W/System.err: at java.lang.Thread.run(Thread.java:784)
2020-12-14 12:00:51.354 24494-25219/troop.com.freedcam D/PictureModuleApi2: internalFireOnWorkDone BurstCount:1 imageCount:1
2020-12-14 12:00:51.354 24494-25219/troop.com.freedcam D/ImageSaveTask: End Saving Bytes
2020-12-14 12:00:51.388 24494-24619/troop.com.freedcam D/BitmapLoader: ImageLoaderTask: LoadImage:2020_12_14_12_00_50.jpg
2020-12-14 12:00:51.388 24494-24714/troop.com.freedcam D/BitmapLoader: ImageLoaderTask: LoadImage:2020_12_14_12_00_18.jpg
2020-12-14 12:00:51.389 24494-24620/troop.com.freedcam D/BitmapLoader: ImageLoaderTask: LoadImage:2020_12_14_11_59_37.jpg
2020-12-14 12:00:51.393 24494-24494/troop.com.freedcam I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time
2020-12-14 12:00:51.399 24494-24503/troop.com.freedcam W/System: A resource failed to call destroy.
2020-12-14 12:00:51.399 24494-24503/troop.com.freedcam D/BackgroundHandlerThread: stopBackgroundThreadCaptureSessionHandler
2020-12-14 12:00:51.399 24494-24503/troop.com.freedcam W/System: A resource failed to call release.
2020-12-14 12:00:51.400 24494-24503/troop.com.freedcam W/MessageQueue: Handler (android.os.Handler) {b9c5f60} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {b9c5f60} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:654)
at android.os.Handler.enqueueMessage(Handler.java:769)
at android.os.Handler.sendMessageAtTime(Handler.java:718)
at android.os.Handler.sendMessageDelayed(Handler.java:688)
at android.os.Handler.post(Handler.java:405)
at android.hardware.camera2.impl.CameraDeviceImpl$CameraHandlerExecutor.execute(CameraDeviceImpl.java:2353)
at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.onClosed(CallbackProxies.java:104)
at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:536)
at android.hardware.camera2.impl.CameraCaptureSessionImpl.finalize(CameraCaptureSessionImpl.java:827)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237)
at java.lang.Daemons$Daemon.run(Daemons.java:103)
at java.lang.Thread.run(Thread.java:784)
2020-12-14 12:00:51.400 24494-24503/troop.com.freedcam W/System: A resource failed to call release.
2020-12-14 12:00:51.418 24494-24619/troop.com.freedcam D/BitmapLoader: Histodata
2020-12-14 12:00:51.418 24494-24619/troop.com.freedcam D/BitmapLoader: ImageLoaderTask: LoadImage Done:2020_12_14_12_00_50.jpg
2020-12-14 12:00:51.420 24494-24714/troop.com.freedcam D/BitmapLoader: Histodata
2020-12-14 12:00:51.420 24494-24714/troop.com.freedcam D/BitmapLoader: ImageLoaderTask: LoadImage Done:2020_12_14_12_00_18.jpg
2020-12-14 12:00:51.422 24494-24620/troop.com.freedcam D/BitmapLoader: Histodata
2020-12-14 12:00:51.422 24494-24620/troop.com.freedcam D/BitmapLoader: ImageLoaderTask: LoadImage Done:2020_12_14_11_59_37.jpg
2020-12-14 12:01:04.843 24494-24494/troop.com.freedcam W/HiTouch_PressGestureDetector: Touch pointer move a lot. The moving distance of X is:93.61426, limit is:60The moving distance of Y is:8.838745, limit is:60
2020-12-14 12:01:06.079 24494-24494/troop.com.freedcam W/HiTouch_PressGestureDetector: Touch pointer move a lot. The moving distance of X is:85.238525, limit is:60The moving distance of Y is:60.95685, limit is:60
2020-12-14 12:01:06.145 24494-24494/troop.com.freedcam I/FLTAG_FM: loadFeature class:com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2020-12-14 12:01:06.145 24494-24494/troop.com.freedcam I/FLTAG_SFM: getRequireClassLoader() succ ! className: com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2020-12-14 12:01:06.145 24494-24494/troop.com.freedcam D/FeatureFactory: loadFeature() : com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2020-12-14 12:01:06.145 24494-24494/troop.com.freedcam D/FeatureFactory: loadFeature() new IHwSplineOverScrollerEx()
2020-12-14 12:01:06.145 24494-24494/troop.com.freedcam D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl paras: android.widget.OverScroller$SplineOverScroller@10ec1b6,freed.cam.ActivityFreeDcamMain@509e104
2020-12-14 12:01:06.145 24494-24494/troop.com.freedcam D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl: mScrollerVelocity is 0, value is 0
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam I/FLTAG_FM: loadFeature class:com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam I/FLTAG_SFM: getRequireClassLoader() succ ! className: com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam D/FeatureFactory: loadFeature() : com.huawei.featurelayer.systemfeature.HwWidget.IHwSplineOverScrollerEx
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam D/FeatureFactory: loadFeature() new IHwSplineOverScrollerEx()
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl paras: android.widget.OverScroller$SplineOverScroller@49d0624,freed.cam.ActivityFreeDcamMain@509e104
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam D/HwSplineOverScrollerExImpl: initSplineOverScrollerImpl: mScrollerVelocity is 0, value is 0
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam D/OverScrollerOptimization: fling time is flingTime = 2.864802069817945 velocity = 7404
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam I/chatty: uid=10196(troop.com.freedcam) identical 2 lines
2020-12-14 12:01:06.146 24494-24494/troop.com.freedcam D/OverScrollerOptimization: fling time is flingTime = 2.864802069817945 velocity = 7404
2020-12-14 12:01:06.147 24494-24494/troop.com.freedcam D/OverScrollerOptimization: fling time is flingTime = 2.406646330383331 velocity = -3109
2020-12-14 12:01:06.147 24494-24494/troop.com.freedcam I/chatty: uid=10196(troop.com.freedcam) identical 2 lines
2020-12-14 12:01:06.147 24494-24494/troop.com.freedcam D/OverScrollerOptimization: fling time is flingTime = 2.406646330383331 velocity = -3109
2020-12-14 12:01:07.331 24494-24494/troop.com.freedcam W/HiTouch_PressGestureDetector: Touch pointer move a lot. The moving distance of X is:99.01221, limit is:60The moving distance of Y is:22.758545, limit is:60
its the same problem. it have something todo with the contentprovider freedcam use
219/troop.com.freedcam W/System.err: java.io.FileNotFoundException: Can't access /2020_12_14_12_00_50.jpg
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:144)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentProviderProxy.openAssetFile(ContentProviderNative.java:625)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1331)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentResolver.openOutputStream(ContentResolver.java:1073)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at android.content.ContentResolver.openOutputStream(ContentResolver.java:1049)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.file.holder.UriHolder.getOutputStream(UriHolder.java:108)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.image.ImageSaveTask.saveJpeg(ImageSaveTask.java:236)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.image.ImageSaveTask.process(ImageSaveTask.java:172)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at freed.image.ImageTask.run(ImageTask.java:21)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
2020-12-14 12:00:51.353 24494-25219/troop.com.freedcam W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
2020-12-14 12:00:51.354 24494-25219/troop.com.freedcam W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2020-12-14 12:00:51.354 24494-25219/troop.com.freedcam W/System.err: at java.lang.Thread.run(Thread.java:784)
think i have to blame me^^
may get replace with
public static boolean needStorageAccessFrameWork = Build.VERSION.SDK_INT > Build.VERSION_CODES.P;
Yes, fixed! Awesome job - again!
Describe the bug After a fresh reinstall from the Play store, I have problems capturing a video. There are multiple problems it seems, first being the missing permission (Huawei only problem? See Screenshot #1). The Logcat gives:
After manually granting permission, The following error occurs:
To Reproduce Steps to reproduce the behavior:
Expected behavior Recording a video should start.
Screenshots
Screenshot
#1
Screenshot
#1
Smartphone (please complete the following information):
Additional context EMUI has recently been updated; Perhaps a problem? The the cellSTORM APP still runs without a problem ;)
I merged into recent Master branch and will have a look what's going on there :)