ParentalControl: crash when openning the setting after changing locale
Description
If you change the locale (I switched from default (US) to French) and go to parental control, it will crash.
I tried from a new install, never having opened parental control, but also after having used parental control from the default locale before changing.
Switching back to default locale, will stop parental control from crashing.
duncan
16:14
2024-07-17 16:12:42.447 23522-23522 AndroidRuntime pid-23522 E FATAL EXCEPTION: main
Process: org.videolan.vlc.debug, PID: 23522
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.videolan.vlc.debug/org.videolan.vlc.gui.PinCodeActivity}: java.lang.ClassCastException: android.content.ContextWrapper cannot be cast to android.app.Application
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3783)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
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:7918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
Caused by: java.lang.ClassCastException: android.content.ContextWrapper cannot be cast to android.app.Application
at org.videolan.vlc.gui.SafeModeModel$Factory.create(PinCodeActivity.kt:430)
at androidx.lifecycle.ViewModelProvider$Factory.create(ViewModelProvider.kt:83)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:187)
at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:153)
at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:53)
at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:35)
at org.videolan.vlc.gui.PinCodeActivity.onCreate$lambda$9(PinCodeActivity.kt:129)
at org.videolan.vlc.gui.PinCodeActivity.onCreate(PinCodeActivity.kt:130)
at android.app.Activity.performCreate(Activity.java:8305)
at android.app.Activity.performCreate(Activity.java:8284)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1418)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3627)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3783)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
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:7918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)
Context
App version
master
Android version
13
Device model
Samsung S10e and Fairphone 5
App mode
Smartphone