MicroG keeps stopping | Errors with BLUETOOTH permissions
- /e/ version: 2.0 (e_dreamlte-user 11 RQ3A.211001.001 eng.root.20240506.223103 dev-keys)
- Device model(s): samsung S8
- Developer mode enabled: yes
- Device rooted: yes
- Trackers blocker enabled: yes
Summary
I have a Samsung S8 that I purchased from the /e/ Foundation with /e/OS pre-installed, and since I updated the OS yesterday, I keep getting an alert saying "MicroG services keeps stopping". I think I already had a problem before the update because I had issues with location accuracy, like the Fairtiq application not finding the train station. However, there wasn't any alert popping up before; at least now I get one.
The problem
Steps to reproduce
Update OS to 2.0 Enabling bluetooth
What is the current behavior?
Every time I turn on Bluetooth, an alert popup appears. I close it by stopping microG services, but it pop up again 5 minutes after or less. Actually before the OS update, I had already noticed that my location is sometimes inaccurate, like an app for buying train tickets not being able to find the train station I'm at, maybe it is related, but I've never had the alert popup.
What is the expected correct behavior?
Not having an alert popup and location working all the time.
Technical informations
Relevant logs (adb logcat)
FATAL EXCEPTION: main
Process: com.google.android.gms, PID: 11182
java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10017 nor current process has android.permission.BLUETOOTH.
at android.os.Parcel.createExceptionOrNull(Parcel.java:2374)
at android.os.Parcel.createException(Parcel.java:2358)
at android.os.Parcel.readException(Parcel.java:2341)
at android.os.Parcel.readException(Parcel.java:2283)
at android.bluetooth.IBluetoothStubStubStubProxy.getState(IBluetooth.java:1811)
at android.bluetooth.BluetoothAdapter$2.recompute(BluetoothAdapter.java:986)
at android.bluetooth.BluetoothAdapter$2.recompute(BluetoothAdapter.java:982)
at android.app.PropertyInvalidatedCache.query(PropertyInvalidatedCache.java:438)
at android.bluetooth.BluetoothAdapter.getStateInternal(BluetoothAdapter.java:1013)
at android.bluetooth.BluetoothAdapter.getState(BluetoothAdapter.java:1040)
at android.bluetooth.BluetoothAdapter.isEnabled(BluetoothAdapter.java:870)
at org.microg.gms.location.settings.DetailedLocationSettingsStatesKt.getDetailedLocationSettingsStates(DetailedLocationSettingsStates.kt:68)
at org.microg.gms.location.manager.LocationManagerInstance$requestLocationSettingsDialog$1.invokeSuspend(LocationManagerInstance.kt:222)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:367)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:172)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at androidx.lifecycle.PausingDispatcherKt$whenStateAtLeast$2.invokeSuspend(PausingDispatcher.kt:203)
at androidx.lifecycle.PausingDispatcherKt$whenStateAtLeast$2.invoke(Unknown Source:8)
at androidx.lifecycle.PausingDispatcherKt$whenStateAtLeast$2.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at androidx.lifecycle.PausingDispatcherKt.whenStateAtLeast(PausingDispatcher.kt:197)
at androidx.lifecycle.PausingDispatcherKt.whenStarted(PausingDispatcher.kt:84)
at androidx.lifecycle.LifecycleCoroutineScope$launchWhenStarted$1.invokeSuspend(Lifecycle.kt:381)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7664)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@d4e9a5b, Dispatchers.Main.immediate]
Relevant screenshots
Solutions
Workaround
If I turn off the bluetooth I don't get the popup anymore.
Possible fixes
It seems like I need to give permissions for Bluetooth to MicroG Services, but I've tried to changed the settings using adb, with adb shell pm grant com.google.android.gms android.permission.BLUETOOTH and I got this message:
Exception occurred while executing 'grant':
java.lang.SecurityException: Package com.google.android.gms has not requested permission android.permission.BLUETOOTH
at com.android.server.pm.permission.BasePermission.enforceDeclaredUsedAndRuntimeOrDevelopment(BasePermission.java:448)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1457)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1410)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2300)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:251)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21921)
at android.os.Binder.shellCommand(Binder.java:929)
at android.os.Binder.onTransact(Binder.java:813)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4621)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4377)
at android.os.Binder.execTransactInternal(Binder.java:1159)
at android.os.Binder.execTransact(Binder.java:1123)
It indicates that microG services has not requested this permission. As I found out, this probably would require modifying the application's manifest locally, but this approach is more technical and risky, as it involves decompiling the APK, adding the missing permission to the manifest, then recompiling and signing the APK, thus I hope there is another way to fix it... ?
Here are more logs from logfox: 23_05-15-10-18_454.log

