The Contacts/acore process, which is often activitymanager killed in the case of low memory and too many boot processes.
Causes the SIM card contact after boot not import or just import part, causes the contact loss phenomenon, but once again the boot can return to normal.
Encountering this problem can be used to provide the Contacts/acore process priority, reduce the probability of being killed by Activitymanager.
Method 1:
Increase process Priority
Startforeground (1, New Notification ());
Reduce process Priority
Stopforeground (TRUE);
NOTICE:
This method can temporarily increase the adj of the corresponding AP to 2.
Method 2:
Locate the corresponding Androidmannifest.xml file for this process, adding the attribute "android:persistent=" to "true",
This allows the process to be set to a resident memory process, which reduces the probability of being killed.
Take the Acore process as an example.
Add a line "android:persistent=" to "true" in the/package/providers/contactsprovider/androidmannifest.xml file
Detailed changes to the scale are as follows:
<application android:process= "Android.process.acore"
Android:label= "@string/app_label"
android:icon= "@drawable/app_icon"
Android:allowbackup= "false"
Android:persistent= "true" <!--new Add code. Ensure that the acore process is not killed by Activitymanager-
>
NOTICE:
This method can temporarily increase the adj of the corresponding AP to 2.
Resolve JE problem (must be included):
Calllogprovider.java (Line1000)
public static final void Notifynewcallscount (Sqlitedatabase db, Context context) {
... ...
LOG.I (TAG, "[notifynewcallscount] Newcallscount =" + Newcallscount);
Send count=0 to clear the unread icon
if (newcallscount >= 0) {
Intent newintent = new Intent (intent.mtk_action_unread_changed);
Newintent.putextra (Intent.mtk_extra_unread_number, Newcallscount);
Newintent.putextra (Intent.mtk_extra_unread_component, New ComponentName (Constants.contacts_package,
constants.contacts_dialtacts_activity));
New Add for fixed JE
Newintent.addflags (Intent.flag_receiver_registered_only_before_boot);
End
Context.sendbroadcast (newintent);
... ...
Android Contacts/acore process is often killed, resulting in the loss of contacts after booting what to do?