Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7eeb95b6 authored by Jack He's avatar Jack He Committed by Andre Eisenbach
Browse files

Remove disk IO read/write blocks in AdapterService for main thread

* Call getSharedPreferences() asynchronously during onCreate() to cache
  preferences in memory as early as possible to prevent ANR
* Change editor.commit() to editor.apply() in AdapterService for:
	setPhonebookAccessPermission
	setMessageAccessPermission
	setSimAccessPermission
  so that these methods will return true when editor.apply() is called.
  After that call, the preference will be updated in memory so that
  following calls that use such preferences will see the change.
  However, there is a possibility that write to persistent storage will
  fail in the background which reset the preference after reboot or service
  restart. In this case, we need to call these method again.
* Same changes in Avrcp for:
	blackListCurrentDevice
	resetBlackList
  In these methods, the return values for editor.commit() are already
  ignored and therefore no user-visible effect.

Bug: 33382877
Test: mannual test, connect to carkit and browse phone book
Change-Id: I605dc00db4647f06c9fa797f272188a44f0e5724
parent 248a6243
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment