deltazefiro / Amarok-Hider

Hide your private files and apps with a single click.
https://deltazefiro.github.io/Amarok-doc/en-US/
Apache License 2.0
1.35k stars 46 forks source link

[BUG] Amarok crashes in work profile #70

Closed navkaran0305 closed 1 year ago

navkaran0305 commented 1 year ago

Describe the bug / 问题描述 Trying to run Amarok in Android work profile results in the app suddenly crashing and not being able to open

To Reproduce / 复现步骤 Steps to reproduce the behavior / 复现异常的步骤:

  1. Install Amarok in Android work profile.
  2. Try to run the Amarok.
  3. The app crashes and refuses to launch.

Expected behavior / 预期行为 The app should open normally and work as intended.

Basic Information / 请填写以下信息:

Additional context / 其他信息

Here is the crash log:

type: crash
osVersion: google/raven/raven:13/TQ3A.230605.012/2023061402:user/release-keys
package: deltazero.amarok.foss:50
process: deltazero.amarok.foss
processUptime: 158 + 260 ms

java.lang.IllegalArgumentException: User 10 is not the current user.
    at android.os.Parcel.createExceptionOrNull(Parcel.java:3025)
    at android.os.Parcel.createException(Parcel.java:3005)
    at android.os.Parcel.readException(Parcel.java:2981)
    at android.os.Parcel.readException(Parcel.java:2923)
    at com.android.internal.statusbar.IStatusBarService$Stub$Proxy.requestTileServiceListeningState(IStatusBarService.java:2380)
    at android.app.StatusBarManager.requestTileServiceListeningState(StatusBarManager.java:904)
    at android.service.quicksettings.TileService.requestListeningState(TileService.java:518)
    at deltazero.amarok.ui.MainActivity.updateUi(MainActivity.java:169)
    at deltazero.amarok.ui.MainActivity.lambda$initUi$1$deltazero-amarok-ui-MainActivity(MainActivity.java:114)
    at deltazero.amarok.ui.MainActivity$$ExternalSyntheticLambda0.onChanged(Unknown Source:4)
    at androidx.lifecycle.LiveData.considerNotify(LiveData.java:133)
    at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:146)
    at androidx.lifecycle.LiveData$ObserverWrapper.activeStateChanged(LiveData.java:468)
    at androidx.lifecycle.LiveData$LifecycleBoundObserver.onStateChanged(LiveData.java:425)
    at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:360)
    at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:271)
    at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:313)
    at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:151)
    at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:134)
    at androidx.lifecycle.ReportFragment.dispatch(ReportFragment.java:68)
    at androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPostStarted(ReportFragment.java:187)
    at android.app.Activity.dispatchActivityPostStarted(Activity.java:1427)
    at android.app.Activity.performStart(Activity.java:8451)
    at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3677)
    at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:224)
    at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:204)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2314)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7937)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
deltazefiro commented 1 year ago

I'm not familiar with Android work profiles, but according to the post:

Apps on work profile cannot interact with tiles from main profile anyway. The tile on Android 12 and below only interact with the app on main profile, and not with the app on work profile.

I'll add a catch to prevent the crash. However, if you run Amarok in the Android work profile, the quick setting tile will be unusable.

navkaran0305 commented 1 year ago

That will be great! Better than not even being able to use the app

deltazefiro commented 1 year ago

@navkaran0305
Would you like to try the CI-built version to see if the issue has been resolved? I don't have a device with a work profile to test it myself.

navkaran0305 commented 1 year ago

@deltazefiro The new version works perfectly. Tested file hiding and biometric authentication

navkaran0305 commented 1 year ago

Accidently closed the issue. My bad

deltazefiro commented 1 year ago

Great. I'll include the fix in the next alpha release soon.

navkaran0305 commented 1 year ago

Amazing !