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

Commit 974fae6a authored by Mao Jinlong's avatar Mao Jinlong Committed by Gerrit - the friendly Code Review server
Browse files

Alarm:Fix issue exchange account disapper after power off alarm

Some application with sync accounts are not being installed during
power off alarm boot mode. So it should not validate accounts and
update sync accounts if it is in power off alarm boot mode.

Change-Id: I7b1aea8a9a472a0e9bbea4123dbd86c311fb9483
CRs-Fixed: 1046815
parent 55f54c5d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import android.os.Parcel;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
@@ -426,6 +427,16 @@ public class AccountManagerService
                    + " userLocked=" + mLocalUnlockedUsers.get(accounts.userId));
        }

        // When OnUserUnlocked or onServiceChanged, this function will be
        // called. It is not necessary to validate accounts during alarm boot as
        // only power off alarm apps are installed. The applications with
        // sync accounts may not be installed during alarm boot. If the applications
        // are not installed, the AccountAuthenticators of these applications
        // will not exist. Then the accounts of the applications will be removed.
        if (SystemProperties.getBoolean("ro.alarm_boot", false)) {
            return;
        }

        if (invalidateAuthenticatorCache) {
            mAuthenticatorCache.invalidateCache(accounts.userId);
        }
+7 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.Message;
import android.os.Parcel;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.util.*;

@@ -892,6 +893,12 @@ public class SyncStorageEngine extends Handler {
     * active accounts.
     */
    public void doDatabaseCleanup(Account[] accounts, int userId) {
        // It is not necessary to clean up database during alarm boot as
        // only power off alarm apps are installed. The applications with
        // sync accounts won't be installed during alarm boot.
        if (SystemProperties.getBoolean("ro.alarm_boot", false)) {
            return;
        }
        synchronized (mAuthorities) {
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Slog.v(TAG, "Updating for new accounts...");