Stuck in boot Animation Hikey970 - Android Pie

There is a permission denied issue on SettingsProvider which has resulted in terminating the SystemServer. Could you please guide me in resolution of the same?

Thanking you!

Logs:

01-01 00:00:40.327 4894 4948 I SchedulingPolicyService: Moving 2926 back to group default
01-01 00:00:40.328 4894 4948 D SystemServerInitThreadPool: Finished executing SchedulingPolicyService.
01-01 00:00:40.329 4894 4894 D SystemServerTiming: StartEntropyMixer took to complete: 4ms
01-01 00:00:40.329 4894 4894 I SystemServer: StartAccountManagerService
01-01 00:00:40.329 4894 4894 I SystemServiceManager: Starting com.android.server.accounts.AccountManagerService$Lifecycle
01-01 00:00:40.331 4894 4894 D SystemServerTiming: StartAccountManagerService took to complete: 1ms
01-01 00:00:40.331 4894 4894 I SystemServer: StartContentService
01-01 00:00:40.331 4894 4894 I SystemServiceManager: Starting com.android.server.content.ContentService$Lifecycle
01-01 00:00:40.331 4894 4894 D SystemServerTiming: StartContentService took to complete: 1ms
01-01 00:00:40.332 4894 4894 I SystemServer: InstallSystemProviders
01-01 00:00:40.335 4894 4907 I Zygote : Process: zygote socket RESERVED/zygote opened, supported ABIS: arm64-v8a
01-01 00:00:40.335 4823 4861 W StreamHAL: Error from HAL stream in function get_presentation_position: Operation not permitted
01-01 00:00:40.337 4894 4894 I system_server: The ClassLoaderContext is a special shared library.
01-01 00:00:40.342 4894 4894 E ContextImpl: Data directory doesn’t exist for package com.android.providers.settings
01-01 00:00:40.342 4894 4894 E ContextImpl: java.lang.Throwable
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.app.ContextImpl.getDataDir(ContextImpl.java:2254)
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.app.ContextImpl.getDatabasesDir(ContextImpl.java:832)
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.app.ContextImpl.getDatabasePath(ContextImpl.java:814)
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:352)
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:298)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.providers.settings.SettingsProvider$SettingsRegistry.migrateAllLegacySettingsIfNeeded(SettingsProvider.java:2603)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.providers.settings.SettingsProvider$SettingsRegistry.(SettingsProvider.java:2136)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.providers.settings.SettingsProvider.onCreate(SettingsProvider.java:318)
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.content.ContentProvider.attachInfo(ContentProvider.java:1917)01-01 00:00:40.342 4894 4894 E ContextImpl: at android.content.ContentProvider.attachInfo(ContentProvider.java:1892)01-01 00:00:40.342 4894 4894 E ContextImpl: at android.app.ActivityThread.installProvider(ActivityThread.java:6391)
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.app.ActivityThread.installContentProviders(ActivityThread.java:5938)
01-01 00:00:40.342 4894 4894 E ContextImpl: at android.app.ActivityThread.installSystemProviders(ActivityThread.java:6578)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.server.am.ActivityManagerService.installSystemProviders(ActivityManagerService.java:12877)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.server.SystemServer.startOtherServices(SystemServer.java:820)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.server.SystemServer.run(SystemServer.java:431)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.server.SystemServer.main(SystemServer.java:294)
01-01 00:00:40.342 4894 4894 E ContextImpl: at java.lang.reflect.Method.invoke(Native Method)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
01-01 00:00:40.342 4894 4894 E ContextImpl: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:838)
01-01 00:00:40.344 4894 4894 E AndroidRuntime: Error reporting WTF
01-01 00:00:40.344 4894 4894 E AndroidRuntime: java.lang.IllegalStateException: Cannot access system provider: ‘settings’ before system providers are installed!

Rootcause:

The root cause of the issue was the below mentioned folder was non existing on the system.img folder structure. Neither the folder is created by the application.

Solution:

As a temporary solution I had created the file. This has enabled my boot up permanently(multiple cold starts). But I think this has to be corrected in the system.img or on the processing HMI application( com.android.providers.settings) side.

Please use the below solution if you are facing any issues until we find the right solution.

mkdir -p /data/user_de/0/com.android.providers.settings/databases/
chown system:system -R /data/user_de/0/
1 Like