Android Contacts/acore process is often killed, resulting in the loss of contacts after booting what to do?

Source: Internet
Author: User

Contacts/acore process, in the case of low memory and too many boot processes will often be activitymanager kill,
Cause the SIM card contact is not imported or only part of the import, resulting in the loss of contacts, but after rebooting can return to normal.


Encountering such a problem can provide the priority of the Contacts/acore process in the following ways, reducing 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, add the property "Android:persistent=" to "true",
This allows the process to be set as a resident memory process, reducing the probability of being killed.
Taking the Acore process as an example,
Add a line "android:persistent=" to "true" in the/package/providers/contactsprovider/androidmannifest.xml file
Examples of specific modifications are:
<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 to 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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.