Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When starting OpenTracks via GadgetBridge no data is being recorded #1904

Open
2 tasks done
sebastianha opened this issue Apr 26, 2024 · 22 comments · May be fixed by #1989
Open
2 tasks done

When starting OpenTracks via GadgetBridge no data is being recorded #1904

sebastianha opened this issue Apr 26, 2024 · 22 comments · May be fixed by #1989
Labels
bug Something isn't working

Comments

@sebastianha
Copy link

When starting a new recording with my Mi Band 7 via Gadgetbridge a new recording is being started with opentracks but directly after the start stopped and no data is being recorded.

I know from old recordings that is worked until at least 2024-03-02, I just discovered that all other recordings are empty since then.

This is only the case when started via Gadgetbridge (via intent?), normal recording works. I checked all the settings, they seem to be correct.

...

Checklist

  • Consulted [https://dontkillmyapp.com/]
  • Power management: battery optimization is disabled for OpenTracks

Technical information

  • Device: Pixel 7
  • OS: GrapheneOS
  • OpenTracks version: 4.12.2
@sebastianha sebastianha added the potential bug A bug that could not (yet) be reproduced label Apr 26, 2024
@dennisguse
Copy link
Member

Might be #1653.

If the screen is off, some Android devices might enforce permission to access the location in the background.
And OpenTracks is not (yet) requesting this permission.

Can you check if it works, if the screen is on?

@sebastianha
Copy link
Author

Also does not work with screen on. I see that only Gadgetbridge is accessing Location and on Opentracks a new record is being created but directly stopped with no data.

@dennisguse
Copy link
Member

Can you check if there is a crash happening (check logcat)?

@sebastianha
Copy link
Author

I cannot see any crash, also when the app is open in foreground it stays open.
I do see a short popup at the top sometime when the app is not open and recording starts.

Screenshot_20240429-220823

@dennisguse
Copy link
Member

Can you start a recording (that has data) via the UI?
And the notification is only shown briefly or does it remain in the notification bar (assuming OpenTracks has a the notification permissoin)?

@sebastianha
Copy link
Author

Yes, with the UI it works.
The notification is only visible for a split second.

@MagiX13
Copy link

MagiX13 commented May 1, 2024

I have the same issue when starting to track via intents (I have a device that I use only for sport activities and use tasker to start tracking once the connection is established). It creates a track of 0 seconds and that's all. Manually starting to track works without issues.
I'm also running on GrapheneOS, but with a different device. The issue started occuring somewhere between 9 and 18 March. I can't say if this comes from 4.12 that I just installed or the new Graphene version that came out during that time frame.
The GrapheneOS logs for the app don't show anything suspicious in my view, but happy to share if needed.

@sebastianha
Copy link
Author

sebastianha commented May 1, 2024

The GrapheneOS logs for the app don't show anything suspicious in my view

Same here

@dennisguse dennisguse added bug Something isn't working and removed potential bug A bug that could not (yet) be reproduced labels May 1, 2024
@dennisguse dennisguse pinned this issue May 1, 2024
@arjan-s
Copy link

arjan-s commented May 6, 2024

Came here to report this exact issue, glad to find it's already known!

@arjan-s
Copy link

arjan-s commented May 6, 2024

Logcat:

1715018922.915 u0_a5 23063 23063 I guse.opentracks: Using CollectorTypeCC GC.
1715018922.918 u0_a5 23063 23063 E guse.opentracks: Not starting debugger since process cannot load the jdwp agent.
1715018922.923 u0_a5 23063 23063 D ActivityThread: setConscryptValidator
1715018922.923 u0_a5 23063 23063 D ActivityThread: setConscryptValidator - put
1715018922.965 u0_a5 23063 23063 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10005; state: ENABLED
1715018922.965 u0_a5 23063 23063 D CompatibilityChangeReporter: Compat change id reported: 242716250; UID 10005; state: ENABLED
1715018922.969 u0_a5 23063 23063 D ApplicationLoaders: Returning zygote-cached class loader: /system_ext/framework/androidx.window.extensions.jar
1715018922.969 u0_a5 23063 23063 D ApplicationLoaders: Returning zygote-cached class loader: /system_ext/framework/androidx.window.sidecar.jar
1715018922.974 u0_a5 23063 23063 D nativeloader: Configuring clns-6 for other apk /data/app/~~DPm3MH_INZEff7GjeqxeCA==/de.dennisguse.opentracks-snJw4ythCiCNwkrRxeEc5A==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~DPm3MH_INZEff7GjeqxeCA==/de.dennisguse.opentracks-snJw4ythCiCNwkrRxeEc5A==/lib/arm64, permitted_path=/data:/mnt/expand:/data/user/0/de.dennisguse.opentracks
1715018922.982 u0_a5 23063 23063 V GraphicsEnvironment: Currently set values for:
1715018922.982 u0_a5 23063 23063 V GraphicsEnvironment:   angle_gl_driver_selection_pkgs=[]
1715018922.982 u0_a5 23063 23063 V GraphicsEnvironment:   angle_gl_driver_selection_values=[]
1715018922.983 u0_a5 23063 23063 V GraphicsEnvironment: ANGLE GameManagerService for de.dennisguse.opentracks: false
1715018922.983 u0_a5 23063 23063 V GraphicsEnvironment: de.dennisguse.opentracks is not listed in per-application setting
1715018922.983 u0_a5 23063 23063 V GraphicsEnvironment: App is not on the allowlist for updatable production driver.
1715018923.014 u0_a5 23063 23063 I Startup : de.dennisguse.opentracks; BuildType: release; VersionName: v4.12.3/v4.12.3 VersionCode: 5753
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: QUALCOMM build                   : 12ae96cb63, I409bbc12eb
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: Build Date                       : 09/13/23
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: EV031.35.01.10
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: Local Branch                     :
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: Remote Branch                    :
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: Remote Branch                    :
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: Reconstruct Branch               :
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: Build Config                     : S P 10.0.7 AArch64
1715018923.020 u0_a5 23063 23085 I AdrenoGLES-0: Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
1715018923.022 u0_a5 23063 23063 D AppCompatDelegate: Checking for metadata for AppLocalesMetadataHolderService : Service not found
1715018923.025 u0_a5 23063 23085 I AdrenoGLES-0: PFP: 0x016dc112, ME: 0x00000000
1715018923.026 u0_a5 23063 23063 E guse.opentracks: Invalid resource ID 0x00000000.
1715018923.032 u0_a5 23063 23063 I DecorView: setWindowBackground: isPopOver=false color=ff141218 d=android.graphics.drawable.ColorDrawable@250703d
1715018923.036 u0_a5 23063 23063 I AbstractAPIActivity: Received and trying to execute requested action.
1715018923.036 u0_a5 23063 23063 I TrackRecordingServiceConnection: Binding and starting the service (not in foreground).
1715018923.044 u0_a5 23063 23063 D CompatibilityChangeReporter: Compat change id reported: 237531167; UID 10005; state: DISABLED
1715018923.047 u0_a5 23063 23063 W libc    : Access denied finding property "persist.dm.passive.sub_display_brightness"
1715018923.047 u0_a5 23063 23063 W libc    : Access denied finding property "persist.dm.passive.sub_ambient_brightness"
1715018923.049 u0_a5 23063 23085 D NativeCustomFrequencyManager: [NativeCFMS] BpCustomFrequencyManager::BpCustomFrequencyManager()
1715018923.059 u0_a5 23063 23063 I InsetsController: onStateChanged: host=de.dennisguse.opentracks/de.dennisguse.opentracks.publicapi.StartRecording, from=android.view.ViewRootImpl.setView:1744, state=InsetsState: {mDisplayFrame=Rect(0, 0 - 840, 2289), mDisplayCutout=DisplayCutout{insets=Rect(0, 82 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(389, 0 - 451, 82), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=840 displayHeight=2289 physicalDisplayWidth=840 physicalDisplayHeight=2289 density={2.65} cutoutSpec={M 0,0 H -11.80952380952381 V 30.85714285714286 H 11.80952380952381 V 0 H 0 Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=0, center=Point(0, 0)}, RoundedCorner{position=TopRight, radius=0, center=Point(0, 0)}, RoundedCorner{position=BottomRight, radius=0, center=Point(0, 0)}, RoundedCorner{position=BottomLeft, radius=0, center=Point(0, 0)}]}  mRoundedCornerFrame=Rect(0, 0 - 840, 2289), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(724, 0 - 840, 82) rotation=0}, mDisplayShape=DisplayShape{ spec=1792337615 displayWidth=832 displayHeight=2268 physicalPixelDisplaySizeRatio=1.0 rotation=0 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {e0130000 mType=statusBars mFrame=[0,0][840,82] mVisible=true mFlags=[]}, InsetsSource: {e0130005 mType=mandatorySystemGestures mFrame=[0,0][840,114] mVisible=true mFlags=[]}, InsetsSource: {e0130006 mType=tappableElement mFrame=[0,0][840,82] mVisible=true mFlags=[]}, InsetsSource: {3 mType=ime mFrame=[0,0][0,0] mVisible=false mFlags=[]}, InsetsSource: {27 mType=displayCutout mFrame=[0,0][840,82] mVisible=true mFlags=[]}, InsetsSource: {6a7c0001 mType=navigationBars mFrame=[0,2250][840,2289] mVisible=true mFlags=[SUPPRESS_SCRIM]}, InsetsSource: {6a7c0004 mType=systemGestures mFrame=[0,0][78,2289] mVisible=true mFlags=[]}, InsetsSource: {6a7c0005 mType=mandatorySystemGestures mFrame=[0,2205][840,2289] mVisible=true mFlags=[]}, InsetsSource: {6a7c0006 mType=tappableElement mFrame=[0,0][0,0] mVisible=true mFlags=[]}, InsetsSource: {6a7c0024 mType=systemGestures mFrame=[762,0][840,2289] mVisible=true mFlags=[]} }
1715018923.059 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: synced displayState. AttachInfo displayState=2
1715018923.062 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: setView = com.android.internal.policy.DecorView@4e543bc TM=true
1715018923.062 u0_a5 23063 23063 I IDS_TAG : Starting IDS observe window
1715018923.062 u0_a5 23063 23063 I IDS_TAG : Getting Shared Preference for de.dennisguse.opentracks.Startup@fa94f45 uid = 10005
1715018923.063 u0_a5 23063 23063 I IDS_TAG : App de.dennisguse.opentracks.Startup@fa94f45 has not finished training
1715018923.065 u0_a5 23063 23063 I IDS_TAG : Closing IDS observe window
1715018923.065 u0_a5 23063 23063 I IDS_TAG : Getting Shared Preference for de.dennisguse.opentracks.Startup@fa94f45 uid = 10005
1715018923.066 u0_a5 23063 23063 I IDS_TAG : IDS count updated to 5 for de.dennisguse.opentracks.Startup@fa94f45
1715018923.083 u0_a5 23063 23063 I BLASTBufferQueue_Java: new BLASTBufferQueue, mName= ViewRootImpl@909ce90[StartRecording] mNativeObject= 0xb400007804934770 sc.mNativeObject= 0xb40000764492af90 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:3015 android.view.ViewRootImpl.relayoutWindow:10048 android.view.ViewRootImpl.performTraversals:4092 android.view.ViewRootImpl.doTraversal:3275 android.view.ViewRootImpl$TraversalRunnable.run:11257 android.view.Choreographer$CallbackRecord.run:1650 android.view.Choreographer$CallbackRecord.run:1659 android.view.Choreographer.doCallbacks:1129 android.view.Choreographer.doFrame:1055 android.view.Choreographer$FrameDisplayEventReceiver.run:1622
1715018923.083 u0_a5 23063 23063 I BLASTBufferQueue_Java: update, w= 840 h= 2289 mName = ViewRootImpl@909ce90[StartRecording] mNativeObject= 0xb400007804934770 sc.mNativeObject= 0xb40000764492af90 format= -1 caller= android.graphics.BLASTBufferQueue.<init>:89 android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:3015 android.view.ViewRootImpl.relayoutWindow:10048 android.view.ViewRootImpl.performTraversals:4092 android.view.ViewRootImpl.doTraversal:3275 android.view.ViewRootImpl$TraversalRunnable.run:11257
1715018923.085 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: Relayout returned: old=(0,0,840,2289) new=(0,0,840,2289) relayoutAsync=false req=(840,2289)0 dur=9 res=0x403 s={true 0xb4000077f49368d0} ch=true seqId=0
1715018923.085 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: performConfigurationChange setNightDimText nightDimLevel=0
1715018923.085 u0_a5 23063 23063 D ViewRootImpl@909ce90[StartRecording]: mThreadedRenderer.initialize() mSurface={isValid=true 0xb4000077f49368d0} hwInitialized=true
1715018923.086 u0_a5 23063 23063 D ViewRootImpl@909ce90[StartRecording]: reportNextDraw android.view.ViewRootImpl.performTraversals:4694 android.view.ViewRootImpl.doTraversal:3275 android.view.ViewRootImpl$TraversalRunnable.run:11257 android.view.Choreographer$CallbackRecord.run:1650 android.view.Choreographer$CallbackRecord.run:1659
1715018923.087 u0_a5 23063 23063 D TrackRecordingService: Create
1715018923.087 u0_a5 23063 23063 I TrackRecordingService: new status null -> RecordingStatus[trackId=null]
1715018923.094 u0_a5 23063 23063 I InsetsSourceConsumer: applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=de.dennisguse.opentracks/de.dennisguse.opentracks.publicapi.StartRecording
1715018923.095 u0_a5 23063 23063 I InsetsSourceConsumer: applyRequestedVisibilityToControl: visible=true, type=statusBars, host=de.dennisguse.opentracks/de.dennisguse.opentracks.publicapi.StartRecording
1715018923.096 u0_a5 23063 23063 I TrackRecordingServiceConnection: Connected to the service: de.dennisguse.opentracks.services.TrackRecordingService$Binder@ab0e0f9
1715018923.096 u0_a5 23063 23063 I TrackRecordingService: startNewTrack
1715018923.104 u0_a5 23063 23063 I TrackRecordingService: new status RecordingStatus[trackId=null] -> RecordingStatus[trackId=Id[id=188]]
1715018923.104 u0_a5 23063 23063 I TrackRecordingService: startSensors
1715018923.104 u0_a5 23063 23063 I SystemUtils: Acquiring wake lock.
1715018923.108 u0_a5 23063 23063 D CompatibilityChangeReporter: Compat change id reported: 263076149; UID 10005; state: ENABLED
1715018923.115 u0_a5 23063 23063 I BluetoothAdapter: BluetoothAdapter() : de.dennisguse.opentracks
1715018923.117 u0_a5 23063 23063 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorGPS to sensorAddress=internal data=null
1715018923.118 u0_a5 23063 23063 I GPSManager: Register for location updates de.dennisguse.opentracks.services.TrackRecordingService@afabef2
1715018923.122 u0_a5 23063 23063 I TrackRecordingService: newGpsStatus: 2131820778
1715018923.122 u0_a5 23063 23063 I NotificationManager: de.dennisguse.opentracks: notify(123, null, Notification(channel=TrackRecordingServiceNotificationManager shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0xa color=0x00000000 category=service vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) as user
1715018923.123 u0_a5 23063 23063 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorBarometer to null
1715018923.124 u0_a5 23063 23063 W BluetoothConnectionManager: NONE: going to disconnect
1715018923.124 u0_a5 23063 23063 W BluetoothConnectionManager: NONE: going to disconnect
1715018923.124 u0_a5 23063 23063 W BluetoothConnectionManager: NONE: going to disconnect
1715018923.124 u0_a5 23063 23063 W BluetoothConnectionManager: NONE: going to disconnect
1715018923.124 u0_a5 23063 23063 W BluetoothConnectionManager: NONE: going to disconnect
1715018923.125 u0_a5 23063 23063 D CompatibilityChangeReporter: Compat change id reported: 160794467; UID 10005; state: ENABLED
1715018923.125 u0_a5 23063 23063 I NotificationManager: de.dennisguse.opentracks: notify(123, null, Notification(channel=TrackRecordingServiceNotificationManager shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0xa color=0x00000000 category=service vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) as user
1715018923.126 u0_a5 23063 23063 I NotificationManager: de.dennisguse.opentracks: notify(123, null, Notification(channel=TrackRecordingServiceNotificationManager shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0xa color=0x00000000 category=service vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) as user
1715018923.129 u0_a5 23063 23063 D TTSManager: Start
1715018923.136 u0_a5 23063 23063 I TextToSpeech: Sucessfully bound to com.google.android.tts
1715018923.138 u0_a5 23063 23063 V MediaPlayer-JNI: native_setup
1715018923.138 u0_a5 23063 23063 V MediaPlayerNative: constructor
1715018923.138 u0_a5 23063 23063 V MediaPlayerNative: setListener
1715018923.138 u0_a5 23063 23063 V MediaPlayer-JNI: get_session_id()
1715018923.144 u0_a5 23063 23063 V MediaPlayer-JNI: setParameter: key 1400
1715018923.144 u0_a5 23063 23063 V MediaPlayerNative: MediaPlayer::setParameter(1400)
1715018923.149 u0_a5 23063 23063 V MediaPlayer-JNI: setDataSourceFD: fd 111
1715018923.149 u0_a5 23063 23063 V MediaPlayerNative: setDataSource(111, 21321196, 66354)
1715018923.151 u0_a5 23063 23092 I TextToSpeech: Connected to TTS engine
1715018923.154 u0_a5 23063 23096 I TextToSpeech: Setting up the connection to TTS engine...
1715018923.162 u0_a5 23063 23063 V MediaPlayerNative: setVideoSurfaceTexture
1715018923.162 u0_a5 23063 23063 V MediaPlayerNative: prepare
1715018923.166 u0_a5 23063 23092 V MediaPlayerNative: message received msg=200, ext1=10973, ext2=0
1715018923.166 u0_a5 23063 23092 W MediaPlayerNative: info/warning (10973, 0)
1715018923.167 u0_a5 23063 23092 V MediaPlayerNative: message received msg=1, ext1=0, ext2=0
1715018923.167 u0_a5 23063 23092 V MediaPlayerNative: MediaPlayer::notify() prepared
1715018923.167 u0_a5 23063 23092 V MediaPlayerNative: signal application thread
1715018923.167 u0_a5 23063 23063 V MediaPlayerNative: prepare complete - status=0
1715018923.167 u0_a5 23063 23063 V MediaPlayerNative: invoke 80
1715018923.167 u0_a5 23063 23063 V MediaPlayerNative: invoke 76
1715018923.169 u0_a5 23063 23063 V MediaPlayer-JNI: setParameter: key 1400
1715018923.169 u0_a5 23063 23063 V MediaPlayerNative: MediaPlayer::setParameter(1400)
1715018923.169 u0_a5 23063 23063 E MediaPlayerNative: trying to set audio attributes called in state 8
1715018923.169 u0_a5 23063 23063 V MediaPlayer-JNI: setLooping: 0
1715018923.169 u0_a5 23063 23063 V MediaPlayerNative: MediaPlayer::setLooping
1715018923.173 u0_a5 23063 23063 I IntentDashboardUtils: Starting dashboard activity with explicit intent (package=nodomain.freeyourgadget.gadgetbridge, class=nodomain.freeyourgadget.gadgetbridge.externalevents.opentracks.OpenTracksController)
1715018923.188 u0_a5 23063 23063 I TTSManager: TextToSpeech initialized with status 0
1715018923.189 u0_a5 23063 23063 V MediaPlayerNative: invoke 76
1715018923.205 u0_a5 23063 23063 D TrackRecordingService: Destroying
1715018923.205 u0_a5 23063 23063 I TrackRecordingService: new status RecordingStatus[trackId=Id[id=188]] -> RecordingStatus[trackId=null]
1715018923.205 u0_a5 23063 23063 I SensorDataSet: Resetting data
1715018923.211 u0_a5 23063 23063 V MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
1715018923.211 u0_a5 23063 23063 V MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
1715018923.211 u0_a5 23063 23063 V MediaPlayer-JNI: release
1715018923.211 u0_a5 23063 23063 V MediaPlayerNative: setListener
1715018923.211 u0_a5 23063 23063 V MediaPlayerNative: disconnect
1715018923.212 u0_a5 23063 23092 I TextToSpeech: Disconnected from TTS engine
1715018923.213 u0_a5 23063 23063 V MediaPlayerNative: destructor
1715018923.213 u0_a5 23063 23063 V MediaPlayerNative: disconnect
1715018923.213 u0_a5 23063 23063 W BluetoothConnectionManager: Not connected; no need to re-connect.
1715018923.213 u0_a5 23063 23063 W BluetoothConnectionManager: Not connected; no need to re-connect.
1715018923.213 u0_a5 23063 23063 W BluetoothConnectionManager: Not connected; no need to re-connect.
1715018923.213 u0_a5 23063 23063 W BluetoothConnectionManager: Not connected; no need to re-connect.
1715018923.213 u0_a5 23063 23063 W BluetoothConnectionManager: Not connected; no need to re-connect.
1715018923.213 u0_a5 23063 23063 D GainManager: Stop
1715018923.214 u0_a5 23063 23063 I TrackRecordingService: newGpsStatus: 2131820772
1715018923.214 u0_a5 23063 23063 I NotificationManager: de.dennisguse.opentracks: notify(123, null, Notification(channel=TrackRecordingServiceNotificationManager shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0xa color=0x00000000 category=service vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) as user
1715018923.215 u0_a5 23063 23063 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorGPS to sensorAddress=internal data=null
1715018923.215 u0_a5 23063 23063 I SensorDataSet: Removing all aggregators
1715018923.216 u0_a5 23063 23063 D TrackRecordingService: Destroyed
1715018923.216 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: handleAppVisibility mAppVisible = true visible = false
1715018923.232 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: Relayout returned: old=(0,0,840,2289) new=(0,0,840,2289) relayoutAsync=false req=(840,2289)8 dur=5 res=0x402 s={false 0x0} ch=true seqId=0
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: Writing exception to parcel
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: java.lang.SecurityException: Permission Denial: reading de.dennisguse.opentracks.data.ShareContentProvider uri content://de.dennisguse.opentracks.content/tracks/187 from pid=21579, uid=10454 requires the provider be exported, or grantUriPermission()
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: 	at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:1050)
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: 	at android.content.ContentProvider.semEnforceReadPermission(ContentProvider.java:968)
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: 	at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:818)
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: 	at android.content.ContentProvider$Transport.query(ContentProvider.java:258)
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: 	at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:107)
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: 	at android.os.Binder.execTransactInternal(Binder.java:1375)
1715018923.263 u0_a5 23063 23092 E DatabaseUtils: 	at android.os.Binder.execTransact(Binder.java:1311)
1715018923.540 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: stopped(true) old = false
1715018923.540 u0_a5 23063 23063 D ViewRootImpl@909ce90[StartRecording]: WindowStopped on de.dennisguse.opentracks/de.dennisguse.opentracks.publicapi.StartRecording set to true
1715018923.542 u0_a5 23063 23063 W WindowOnBackDispatcher: sendCancelIfRunning: isInProgress=falsecallback=android.app.Activity$$ExternalSyntheticLambda0@da71bcb
1715018923.545 u0_a5 23063 23063 I ViewRootImpl@909ce90[StartRecording]: dispatchDetachedFromWindow
1715018923.548 u0_a5 23063 23063 D InputTransport: Input channel destroyed: '51ab604', fd=98
1715018928.208 u0_a5 23063 23572 D ProfileInstaller: Installing profile for de.dennisguse.opentracks

Specifically this line seems to be the culprit:

1715018923.263 u0_a5 23063 23092 E DatabaseUtils: java.lang.SecurityException: Permission Denial: reading de.dennisguse.opentracks.data.ShareContentProvider uri content://de.dennisguse.opentracks.content/tracks/187 from pid=21579, uid=10454 requires the provider be exported, or grantUriPermission()

@sgofferj
Copy link

sgofferj commented May 8, 2024

I have the same issue and I observed the following:

  • When I open OpenTracks, GPS is turned off (struck out icon)
  • When I start a recording from the UI, GPS is turned on
  • When I stop the recording in the UI, GPS is turned off again
  • When I try to start a recording via intent, it doesn't record anything
  • When I turn on GPS in the UI and then send the intent, OT records properly but turns off GPS after recording

Those issues did not occur before 03 APR 2024. I'm using nightly via F-Droid on Andorid 12.

@Just-Explode
Copy link

This also happens to me on either Android 14 (SM-A1560) for using Automate/App Start Block or adb shell intent ,or Android 11 (Waydroid) for using adb shell intent. I'm using v4.13.0 on both machine
I'm not sure about how this app works and I don't have much experience on coding Android app. But I wanna make a guess that maybe this bug is caused because it asks for location permission with "Allow only while using the app" instead of "All the time". Just my humble opinion. Maybe I was wrong, idk. I don't know how to touch these code yet.

Also I did 2 logcats on Waydroid, one is for "Activating GPS in main UI by touching the GPS button then run the intent", the other is "Start the main UI without touching the GPS button then run the intent". I use fake GPS to emulate GPS on Waydroid. And it can record on both machine by pressing the recording button in the main UI.

Here's "Activating GPS in main UI by touching the GPS button then run the intent" logcat:

08-16 13:48:54.090    84    84 E SurfaceFlinger: [Sprite#0] rejecting buffer: bufWidth=31, bufHeight=39, front.active_legacy.{w=35, h=35}
08-16 13:48:54.206 12664 12664 I TrackRecordingServiceConnection: Binding the service.
08-16 13:48:54.222 12664 12664 D TrackRecordingService: Create
08-16 13:48:54.222 12664 12664 I TrackRecordingService: new status null -> RecordingStatus[trackId=null]
08-16 13:48:54.224 12664 12664 I TrackRecordingServiceConnection: Connected to the service: de.dennisguse.opentracks.services.TrackRecordingService$Binder@f80aee1
08-16 13:48:54.224 12664 12664 I TrackRecordingServiceConnection: Connected to the service: de.dennisguse.opentracks.services.TrackRecordingService$Binder@f80aee1
08-16 13:48:54.225 12664 12664 I TrackRecordingService: tryStartSensors
08-16 13:48:54.225 12664 12664 I TrackRecordingService: startSensors
08-16 13:48:54.225 12664 12664 I SystemUtils: Acquiring wake lock.
08-16 13:48:54.226 12664 12664 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorGPS to sensorAddress=internal data=null
08-16 13:48:54.227 12664 12664 I GPSManager: Register for location updates de.dennisguse.opentracks.services.TrackRecordingService@d826e3a
08-16 13:48:54.228 12664 12664 I TrackRecordingService: newGpsStatus: 2131820780
08-16 13:48:54.229 12664 12664 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorBarometer to null
08-16 13:48:54.229 12664 12664 W BluetoothConnectionManager: Bluetooth not enabled.
08-16 13:48:54.231   252  5295 I ActivityManager: Killing 11478:com.google.android.gms.unstable/u0a144 (adj 995): empty for 1810s
08-16 13:48:54.229 12664 12664 I chatty  : uid=10176(de.dennisguse.opentracks) identical 3 lines
08-16 13:48:54.229 12664 12664 W BluetoothConnectionManager: Bluetooth not enabled.
08-16 13:48:54.232   252   280 W libprocessgroup: Failed to open process cgroup uid 10144 pid 11478: Permission denied
08-16 13:48:54.232   252   280 E libprocessgroup: Error encountered killing process cgroup uid 10144 pid 11478: Permission denied
08-16 13:48:54.240    62    62 I Zygote  : Process 11478 exited due to signal 9 (Killed)
08-16 13:48:54.293   252 12591 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:48:54.293   252 12591 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:48:54.294   252   267 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:48:54.432   252   252 D NotificationService: 0|de.dennisguse.opentracks|123|null|10176: granting content://settings/system/notification_sound
08-16 13:48:54.433   252   252 I chatty  : uid=1000 system_server identical 2 lines
08-16 13:48:54.433   252   252 D NotificationService: 0|de.dennisguse.opentracks|123|null|10176: granting content://settings/system/notification_sound
08-16 13:48:54.434   252   252 W NotificationHistory: Attempted to add notif for locked/gone/disabled user 0
08-16 13:48:54.436   129   675 D NuPlayerDriver: NuPlayerDriver(0xf7bc0600) created, clientPid(382)
08-16 13:48:54.440   129 12999 D GenericSource: FileSource remote
08-16 13:48:54.442   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:48:54.445   127   391 E Utils   : did not find channel-count and/or sample-rate
08-16 13:48:54.446   127   391 E Utils   : did not find channel-count and/or sample-rate
08-16 13:48:54.447   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:48:54.451   252 12591 I MediaFocusControl: requestAudioFocus() from uid/pid 10132/382 clientId=android.media.AudioManager@68d418 callingPack=com.android.systemui req=3 flags=0x0 sdk=30
08-16 13:48:54.452   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:48:54.456   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:48:54.474   382   382 W TouchableRegionManager: onHeadsUpPinnedModeChanged
08-16 13:48:54.475   382   382 D StatusBar: disable<e i a s b h r c s > disable2<q i n >
08-16 13:48:54.483   382   382 D StatusBar: disable<e i a s b h r c s > disable2<q i n >
08-16 13:48:54.560    81   196 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1
08-16 13:48:54.560   252  6246 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:48:54.952   129 12998 I GenericSource: start
08-16 13:48:54.954   382   382 V MediaRouter: Selecting route: RouteInfo{ name=手機, description=null, status=null, category=RouteCategory{ name=系統 types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
08-16 13:48:54.959   129 13004 I OMXClient: IOmx service obtained
08-16 13:48:54.959   132   203 I OMXMaster: makeComponentInstance(OMX.google.vorbis.decoder) in android.hardwar process
08-16 13:48:54.961   129 13004 D MediaCodec: flushMediametrics
08-16 13:48:54.961   132   203 E OMXNodeInstance: setConfig(0xf7baa660:google.vorbis.decoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
08-16 13:48:54.962   129 13004 I ACodec  : codec does not support config priority (err -2147483648)
08-16 13:48:54.963   129 13004 I MediaCodec: MediaCodec will operate in async mode
08-16 13:48:54.978    81   202 D AudioFlinger: Client defaulted notificationFrames to 11286 for frameCount 22572
08-16 13:48:54.979    81   202 D AF::TrackHandle: OpPlayAudio: track:91 usage:5 not muted
08-16 13:48:55.074   252  6246 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:48:55.868   129 13002 D AudioTrack: stop(43): called with 52920 frames delivered
08-16 13:48:56.301 12664 12664 I TrackRecordingService: newGpsStatus: 2131820775
08-16 13:48:56.303 12664 12664 W TrackRecordingService: Ignore newTrackPoint. Not recording.
08-16 13:48:56.442   252  1471 I MediaFocusControl: abandonAudioFocus() from uid/pid 10132/382 clientId=android.media.AudioManager@68d418
08-16 13:48:56.443   382 12996 V MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
08-16 13:48:56.443   382 12996 V MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
08-16 13:48:56.443   129   675 D NuPlayerDriver: reset(0xf7bc0600) at state 6
08-16 13:48:56.448   129 13003 D MediaCodec: flushMediametrics
08-16 13:48:56.449   129 12998 D NuPlayerDriver: notifyResetComplete(0xf7bc0600)
08-16 13:48:56.449   129   675 W AMessage: failed to post message as target looper for handler 0 is gone.
08-16 13:48:56.522    81   196 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1
08-16 13:48:56.523   252  6246 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:48:59.304 12664 12664 W TrackRecordingService: Ignore newTrackPoint. Not recording.
08-16 13:48:59.468   252   267 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:49:00.001   382   382 D KeyguardClockSwitch: Updating clock: 1:49
08-16 13:49:00.172   382   382 W TouchableRegionManager: onHeadsUpPinnedModeChanged
08-16 13:49:00.641   382   382 D StatusBar: disable<e i a s b h r c s > disable2<q i n >
08-16 13:49:00.647   382   382 D StatusBar: disable<e i a s b h r c s > disable2<q i n >
08-16 13:49:02.308 12664 12664 W TrackRecordingService: Ignore newTrackPoint. Not recording.
08-16 13:49:02.851   252  6246 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=de.dennisguse.opentracks/.publicapi.StartRecording} from uid 2000
08-16 13:49:02.853   252  6246 E BoringdroidConfig: Don't save package windowing mode when pc mode disabled
08-16 13:49:02.856 13011 13013 I cmd     : oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:49:02.858   252 12591 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (10942977)
08-16 13:49:02.866 12664 12664 I android_os_HwBinder: HwBinder: Starting hwbinderthread pool for getting: [email protected]::IWaydroidWindow/default
08-16 13:49:02.869 12664 12664 I AbstractAPIActivity: Received and trying to execute requested action.
08-16 13:49:02.869 12664 12664 I TrackRecordingServiceConnection: Binding and starting the service (not in foreground).
08-16 13:49:02.877 12664 12664 I TrackRecordingServiceConnection: Connected to the service: de.dennisguse.opentracks.services.TrackRecordingService$Binder@f80aee1
08-16 13:49:02.877 12664 12664 I TrackRecordingService: startNewTrack
08-16 13:49:02.904 12664 12664 I TrackRecordingService: new status RecordingStatus[trackId=null] -> RecordingStatus[trackId=Id[id=14]]
08-16 13:49:02.904 12664 12664 I TrackRecordingService: sensors already started; skipping
08-16 13:49:02.904 12664 12664 D TTSManager: Start
08-16 13:49:02.905 12664 12664 I TTSManager: TextToSpeech initialized with status -1
08-16 13:49:02.907   129   675 D NuPlayerDriver: NuPlayerDriver(0xf7bc0600) created, clientPid(12664)
08-16 13:49:02.910   129   675 E AudioSystem: invalid attributes { Content type: AUDIO_CONTENT_TYPE_UNKNOWN Usage: AUDIO_USAGE_UNKNOWN Source: -1 Flags: 0x800 Tags:  } when converting to stream
08-16 13:49:02.910   129 13019 D GenericSource: FileSource remote
08-16 13:49:02.911   127   391 E Utils   : did not find channel-count and/or sample-rate
08-16 13:49:02.912   127   391 E Utils   : did not find channel-count and/or sample-rate
08-16 13:49:02.913 12664 12664 E MediaPlayerNative: trying to set audio attributes called in state 8
08-16 13:49:02.947    27    27 I hwservicemanager: getTransport: Cannot find entry [email protected]::IMapper/default in either framework or device manifest.
08-16 13:49:02.948   252  8439 W MESA    : Using gralloc header from libdrm/android/gralloc_handle.h.  This is not recommended for new distributions.  Initializing a fallback gralloc as a helper:
08-16 13:49:02.948   252  8439 I MESA    : Using fallback gralloc implementation
08-16 13:49:02.950   252  8439 W EGL-MAIN: failed to get driver name for fd -1
08-16 13:49:02.950   252  8439 W EGL-MAIN: MESA-LOADER: failed to retrieve device information
08-16 13:49:02.950   252  8439 W EGL-MAIN: failed to get driver name for fd -1
08-16 13:49:02.965   382   402 W System  : A resource failed to call release. 
08-16 13:49:02.985   863   863 I GoogleInputMethodService: GoogleInputMethodService.onFinishInput():3184 
08-16 13:49:02.986   863   863 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2246 repeatCheckTimes = 0, locked = false
08-16 13:49:02.986   863   863 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1982 onStartInput(EditorInfo{EditorInfo{packageName=de.dennisguse.opentracks, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=-1, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
08-16 13:49:02.987   863   863 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2246 repeatCheckTimes = 1, locked = false
08-16 13:49:02.987   863   863 I AndroidIME: InputBundleManager.loadActiveInputBundleId():450 loadActiveInputBundleId: und-Latn-x-password, password
08-16 13:49:05.335 12664 12664 I SensorDataSet: Resetting data
08-16 13:49:08.319 12664 12664 D TrackRecordingManager: Not recording TrackPoint
08-16 13:49:12.854   252   272 W ActivityTaskManager: Launch timeout has expired, giving up wake lock!
08-16 13:49:12.862   252   272 I ActivityManager: PendingStartActivityUids startActivity to updateOomAdj delay:9925ms, uid:10176

Here's "Start the main UI without touching the GPS button then run the intent" logcat:

08-16 13:50:31.173   252  6246 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=de.dennisguse.opentracks/.publicapi.StartRecording} from uid 2000
08-16 13:50:31.174   252  6246 E BoringdroidConfig: Don't save package windowing mode when pc mode disabled
08-16 13:50:31.176 13057 13059 I cmd     : oneway function results will be dropped but finished with status OK and parcel size 4
08-16 13:50:31.177   252  2977 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (11093873)
08-16 13:50:31.185 12664 12664 I android_os_HwBinder: HwBinder: Starting hwbinderthread pool for getting: [email protected]::IWaydroidWindow/default
08-16 13:50:31.187 12664 12664 I AbstractAPIActivity: Received and trying to execute requested action.
08-16 13:50:31.187 12664 12664 I TrackRecordingServiceConnection: Binding and starting the service (not in foreground).
08-16 13:50:31.192 12664 12664 D TrackRecordingService: Create
08-16 13:50:31.192 12664 12664 I TrackRecordingService: new status null -> RecordingStatus[trackId=null]
08-16 13:50:31.208 12664 12664 I TrackRecordingServiceConnection: Connected to the service: de.dennisguse.opentracks.services.TrackRecordingService$Binder@ce85167
08-16 13:50:31.209 12664 12664 I TrackRecordingServiceConnection: Connected to the service: de.dennisguse.opentracks.services.TrackRecordingService$Binder@ce85167
08-16 13:50:31.209 12664 12664 I TrackRecordingService: startNewTrack
08-16 13:50:31.233 12664 12664 I TrackRecordingService: new status RecordingStatus[trackId=null] -> RecordingStatus[trackId=Id[id=15]]
08-16 13:50:31.233 12664 12664 I TrackRecordingService: startSensors
08-16 13:50:31.233 12664 12664 I SystemUtils: Acquiring wake lock.
08-16 13:50:31.235 12664 12664 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorGPS to sensorAddress=internal data=null
08-16 13:50:31.235 12664 12664 I GPSManager: Register for location updates de.dennisguse.opentracks.services.TrackRecordingService@8de7d49
08-16 13:50:31.236 12664 12664 I TrackRecordingService: newGpsStatus: 2131820780
08-16 13:50:31.237 12664 12664 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorBarometer to null
08-16 13:50:31.238 12664 12664 W BluetoothConnectionManager: Bluetooth not enabled.
08-16 13:50:31.238 12664 12664 I chatty  : uid=10176(de.dennisguse.opentracks) identical 3 lines
08-16 13:50:31.238 12664 12664 W BluetoothConnectionManager: Bluetooth not enabled.
08-16 13:50:31.241 12664 12664 D TTSManager: Start
08-16 13:50:31.242 12664 12664 I TTSManager: TextToSpeech initialized with status -1
08-16 13:50:31.243   129   675 D NuPlayerDriver: NuPlayerDriver(0xf7bc0600) created, clientPid(12664)
08-16 13:50:31.246   129   675 E AudioSystem: invalid attributes { Content type: AUDIO_CONTENT_TYPE_UNKNOWN Usage: AUDIO_USAGE_UNKNOWN Source: -1 Flags: 0x800 Tags:  } when converting to stream
08-16 13:50:31.246   129 13063 D GenericSource: FileSource remote
08-16 13:50:31.248   127   127 E Utils   : did not find channel-count and/or sample-rate
08-16 13:50:31.248   127   127 E Utils   : did not find channel-count and/or sample-rate
08-16 13:50:31.252 12664 12664 E MediaPlayerNative: trying to set audio attributes called in state 8
08-16 13:50:31.267 12664 12680 W System  : A resource failed to call close. 
08-16 13:50:31.268 12664 12664 I TrackRecordingServiceConnection: Disconnected from the service.
08-16 13:50:31.268 12664 12664 D TrackRecordingService: Destroying
08-16 13:50:31.268 12664 12664 I TrackRecordingService: new status RecordingStatus[trackId=Id[id=15]] -> RecordingStatus[trackId=null]
08-16 13:50:31.268 12664 12664 I SensorDataSet: Resetting data
08-16 13:50:31.268 12664 12680 W System  : A resource failed to call close. 
08-16 13:50:31.290 12664 12664 W TextToSpeech: shutdown failed: not bound to TTS engine
08-16 13:50:31.291 12664 12664 V MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
08-16 13:50:31.291 12664 12664 V MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
08-16 13:50:31.291   129   675 D NuPlayerDriver: reset(0xf7bc0600) at state 4
08-16 13:50:31.291   129 13062 D NuPlayerDriver: notifyResetComplete(0xf7bc0600)
08-16 13:50:31.292 12664 12664 W BluetoothConnectionManager: Not connected; no need to re-connect.
08-16 13:50:31.292 12664 12664 I chatty  : uid=10176(de.dennisguse.opentracks) identical 3 lines
08-16 13:50:31.292 12664 12664 W BluetoothConnectionManager: Not connected; no need to re-connect.
08-16 13:50:31.292 12664 12664 D GainManager: Stop
08-16 13:50:31.292 12664 12664 I TrackRecordingService: newGpsStatus: 2131820774
08-16 13:50:31.293 12664 12664 I SensorDataSet: Setting aggregator de.dennisguse.opentracks.sensors.sensorData.AggregatorGPS to sensorAddress=internal data=null
08-16 13:50:31.293 12664 12664 I SensorDataSet: Removing all aggregators
08-16 13:50:31.294 12664 12664 D TrackRecordingService: Destroyed
08-16 13:50:31.315    27    27 I hwservicemanager: getTransport: Cannot find entry [email protected]::IMapper/default in either framework or device manifest.
08-16 13:50:31.315   252  8439 W MESA    : Using gralloc header from libdrm/android/gralloc_handle.h.  This is not recommended for new distributions.  Initializing a fallback gralloc as a helper:
08-16 13:50:31.316   252  8439 I MESA    : Using fallback gralloc implementation
08-16 13:50:31.317   252  8439 W EGL-MAIN: failed to get driver name for fd -1
08-16 13:50:31.317   252  8439 W EGL-MAIN: MESA-LOADER: failed to retrieve device information
08-16 13:50:31.317   252  8439 W EGL-MAIN: failed to get driver name for fd -1
08-16 13:50:31.358   863   863 I GoogleInputMethodService: GoogleInputMethodService.onFinishInput():3184 
08-16 13:50:31.358   863   863 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2246 repeatCheckTimes = 0, locked = false
08-16 13:50:31.359   863   863 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1982 onStartInput(EditorInfo{EditorInfo{packageName=de.dennisguse.opentracks, inputType=0, inputTypeString=NULL, enableLearning=false, autoCorrection=false, autoComplete=false, imeOptions=0, privateImeOptions=null, actionName=UNSPECIFIED, actionLabel=null, initialSelStart=-1, initialSelEnd=-1, initialCapsMode=0, label=null, fieldId=-1, fieldName=null, extras=null, hintText=null, hintLocales=[]}}, false)
08-16 13:50:31.359   863   863 I GoogleInputMethodService: GoogleInputMethodService.updateDeviceLockedStatus():2246 repeatCheckTimes = 1, locked = false
08-16 13:50:31.359   863   863 I AndroidIME: InputBundleManager.loadActiveInputBundleId():450 loadActiveInputBundleId: und-Latn-x-password, password
08-16 13:50:31.440   252   252 D NotificationService: 0|de.dennisguse.opentracks|123|null|10176: granting content://settings/system/notification_sound
08-16 13:50:31.441   252   252 I chatty  : uid=1000 system_server identical 2 lines
08-16 13:50:31.441   252   252 D NotificationService: 0|de.dennisguse.opentracks|123|null|10176: granting content://settings/system/notification_sound
08-16 13:50:31.442   252   252 W NotificationHistory: Attempted to add notif for locked/gone/disabled user 0
08-16 13:50:31.444   129   675 D NuPlayerDriver: NuPlayerDriver(0xf7bc0600) created, clientPid(382)
08-16 13:50:31.447   129 13073 D GenericSource: FileSource remote
08-16 13:50:31.448   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:50:31.449   127   704 E Utils   : did not find channel-count and/or sample-rate
08-16 13:50:31.449   127   704 E Utils   : did not find channel-count and/or sample-rate
08-16 13:50:31.451   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:50:31.452   252  2977 I MediaFocusControl: requestAudioFocus() from uid/pid 10132/382 clientId=android.media.AudioManager@5946025 callingPack=com.android.systemui req=3 flags=0x0 sdk=30
08-16 13:50:31.454   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:50:31.457   382   382 W NotifBindPipeline: Row is not set so pipeline will not run. notif = 0|de.dennisguse.opentracks|123|null|10176
08-16 13:50:31.472   382   382 W TouchableRegionManager: onHeadsUpPinnedModeChanged
08-16 13:50:31.472   382   382 D StatusBar: disable<e i a s b h r c s > disable2<q i n >
08-16 13:50:31.494   252   252 E NotificationService: Muting recently noisy 0|de.dennisguse.opentracks|123|null|10176
08-16 13:50:31.495   252   252 D NotificationService: 0|de.dennisguse.opentracks|123|null|10176: granting content://settings/system/notification_sound
08-16 13:50:31.495   252   252 I chatty  : uid=1000 system_server identical 2 lines
08-16 13:50:31.495   252   252 D NotificationService: 0|de.dennisguse.opentracks|123|null|10176: granting content://settings/system/notification_sound
08-16 13:50:31.496   252   252 W NotificationHistory: Attempted to add notif for locked/gone/disabled user 0
08-16 13:50:31.479   382   382 D StatusBar: disable<e i a s b h r c s > disable2<q i n >
08-16 13:50:31.953   382   382 V MediaRouter: Selecting route: RouteInfo{ name=手機, description=null, status=null, category=RouteCategory{ name=系統 types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO  groupable=false }, supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO , presentationDisplay=null }
08-16 13:50:31.953   129 13072 I GenericSource: start
08-16 13:50:31.957   129   675 D NuPlayerDriver: stop(0xf7bc0600)
08-16 13:50:31.957   382 13069 V MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
08-16 13:50:31.957   382 13069 V MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
08-16 13:50:31.958   129   675 D NuPlayerDriver: reset(0xf7bc0600) at state 8
08-16 13:50:31.960   129 13077 I OMXClient: IOmx service obtained
08-16 13:50:31.960   132   203 I OMXMaster: makeComponentInstance(OMX.google.vorbis.decoder) in android.hardwar process
08-16 13:50:31.961   129 13077 D MediaCodec: flushMediametrics
08-16 13:50:31.962   132   203 E OMXNodeInstance: setConfig(0xf7baa660:google.vorbis.decoder, ConfigPriority(0x6f800002)) ERROR: Undefined(0x80001001)
08-16 13:50:31.962   129 13077 I ACodec  : codec does not support config priority (err -2147483648)
08-16 13:50:31.963   129 13077 I MediaCodec: MediaCodec will operate in async mode
08-16 13:50:31.971   129 13076 D MediaCodec: flushMediametrics
08-16 13:50:31.972   129 13072 D NuPlayerDriver: notifyResetComplete(0xf7bc0600)
08-16 13:50:31.972   129   675 W AMessage: failed to post message as target looper for handler 0 is gone.
08-16 13:50:31.973   252  5295 I MediaFocusControl: abandonAudioFocus() from uid/pid 10132/382 clientId=android.media.AudioManager@5946025
08-16 13:50:33.475   382   382 W TouchableRegionManager: onHeadsUpPinnedModeChanged
08-16 13:50:33.943   382   382 D StatusBar: disable<e i a s b h r c s > disable2<q i n >

logcat on SM-A1560 is so messy that I have no idea how to treat it. I'm sorry.

@Just-Explode
Copy link

Just-Explode commented Aug 16, 2024

oh wait... I see that after Android 11 (API 30) you need to somehow grant the user ACCESS_FINE_LOCATION then ask them for ACCESS_BACKGROUND_LOCATION. (will this be persistence?) after reading this and the issue you mentioned.

Idk if I can help, but i'd like to try. But idk how's the progress now yet. (sorry) I think your can add two button in the Setting/PublicAPI option, one of them is "Get GPS permission", and the other "Allow running in the background" will be present or enable after clicking the above one? Since the user is already getting their hands on APIs, I think we can just let the user know the fact that it's Android forcing us to do so?
Sorry if you guys already implemented that.

@Just-Explode
Copy link

lol idk why but I managed to learned how to do basic modification to this app with ChatGPT.
I did what I did to the app. Here's a screenshot (forgive me but i use Traditional chinese with meanless strings)
Screenshot_20240816_161903

Welp, now I do have a checkbox called always allow location permission in setting ( i think it's caused by edit to AndroidManifest.xml?). But still this doesn't change anything.
I'm now thinking about it was either the way this app initiates, or how it stops recording from app or intent somehow stops the ACCESS_FINE_LOCATION for ACCESS_BACKGROUND_LOCATION? idk but i'll try

@Just-Explode
Copy link

Just-Explode commented Aug 16, 2024

nvm i wanna do something else for now. reading java code is a huge pain to me even with ChatGPT and Android Studio
edit: ok maybe ACCESS_BACKGROUND_LOCATION is unnecessary. this app runs as foreground service (right?)

@sgofferj
Copy link

I would think, it is unnecessary, because this issue popped up somewhen in Spring of this year. Probably some change in the code broke the functionality.

@MaximusdaVII
Copy link

MaximusdaVII commented Sep 18, 2024

I think it has to do with a change in the Location permissions. I found an old apk of Opentracks v4.8.0 where the location permission looks like this:
Screenshot_20240918-223924
On the Versions since about Spring this Year they look like this:
markup_77845
There is no way to allow Location Access all the Time.
I hope there is a way to bring this back.

@abdoulayeYATERA
Copy link

Looks like a permission issue:

android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false

Exception in thread "main": android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service de.dennisguse.opentracks.debug/de.dennisguse.opentracks.services.TrackRecordingService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:5016)
	at android.os.Parcel.readParcelable(Parcel.java:4998)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3178)
	at android.os.Parcel.createException(Parcel.java:3167)
	at android.os.Parcel.readException(Parcel.java:3150)
	at android.os.Parcel.readException(Parcel.java:3092)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6960)
	at android.app.Service.startForeground(Service.java:863)
	at androidx.core.app.ServiceCompat$Api34Impl.startForeground(ServiceCompat.java:241)
	at androidx.core.app.ServiceCompat.startForeground(ServiceCompat.java:172)
	at de.dennisguse.opentracks.services.TrackRecordingService.startSensors(TrackRecordingService.java:217)
	at de.dennisguse.opentracks.services.TrackRecordingService.startRecording(TrackRecordingService.java:195)
	at de.dennisguse.opentracks.services.TrackRecordingService.startNewTrack(TrackRecordingService.java:175)
	at de.dennisguse.opentracks.publicapi.StartRecording.execute(StartRecording.java:28)
	at de.dennisguse.opentracks.publicapi.AbstractAPIActivity.lambda$new$0(AbstractAPIActivity.java:22)
	at de.dennisguse.opentracks.publicapi.AbstractAPIActivity.$r8$lambda$yfwvwPfCJ0TKcPOvTGugdZ7vk5g(Unknown Source:0)
	at de.dennisguse.opentracks.publicapi.AbstractAPIActivity$$ExternalSyntheticLambda1.onConnected(D8$$SyntheticClass:0)
	at de.dennisguse.opentracks.services.TrackRecordingServiceConnection.lambda$execute$1(TrackRecordingServiceConnection.java:154)
	at de.dennisguse.opentracks.services.TrackRecordingServiceConnection$$ExternalSyntheticLambda2.onConnected(D8$$SyntheticClass:0)
	at de.dennisguse.opentracks.services.TrackRecordingServiceConnection.setTrackRecordingService(TrackRecordingServiceConnection.java:135)
	at de.dennisguse.opentracks.services.TrackRecordingServiceConnection.-$$Nest$msetTrackRecordingService(Unknown Source:0)
	at de.dennisguse.opentracks.services.TrackRecordingServiceConnection$1.onServiceConnected(TrackRecordingServiceConnection.java:62)
	at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:2206)
	at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2239)
	at android.os.Handler.handleCallback(Handler.java:959)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8592)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

@Just-Explode
Copy link

There is no way to allow Location Access all the Time.
I hope there is a way to bring this back.

I don't think there's a need for background permission. I read that app can have permission to do so if runs as foreground service(with a notification) from google's doc.
Correct me if I'm wrong, hopefully the devs knows what should happen

@abdoulayeYATERA
Copy link

abdoulayeYATERA commented Sep 25, 2024

There is no way to allow Location Access all the Time.
I hope there is a way to bring this back.

I don't think there's a need for background permission. I read that app can have permission to do so if runs as foreground service(with a notification) from google's doc. Correct me if I'm wrong, hopefully the devs knows what should happen

Indeed, the service is trying to launch foreground notification while being itself launched from background (intent). That's the issue it seems.

Which is bizarre because the intent does not call the service directly, but call an activity (which should bring the app on foreground)

@abdoulayeYATERA
Copy link

abdoulayeYATERA commented Sep 25, 2024

@Just-Explode Here a fix

Just changed the "AbtractApiActivity.java" "onCreate" method.

Replaced

TrackRecordingServiceConnection.execute(this, serviceConnectedCallback);

By

TrackRecordingServiceConnection.executeForeground(this, serviceConnectedCallback);

Not a all a stable fix ok.
No need to send you the apk, saw that you are able to compile already.
Just make that small change and install, should be good (I hope haha).

@Just-Explode
Copy link

Replaced

TrackRecordingServiceConnection.execute(this, serviceConnectedCallback);

By

TrackRecordingServiceConnection.executeForeground(this, serviceConnectedCallback);

OMG it's really glad to see a potential fix, I will definitely try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants