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

Commit 09e1fae7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add boot/shutdown timing to sync detailed logging" into oc-dr1-dev

parents 635575d5 fe224e0e
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -102,6 +102,22 @@ public final class ContentService extends IContentService.Stub {
            }
        }


        @Override
        public void onStartUser(int userHandle) {
            mService.onStartUser(userHandle);
        }

        @Override
        public void onUnlockUser(int userHandle) {
            mService.onUnlockUser(userHandle);
        }

        @Override
        public void onStopUser(int userHandle) {
            mService.onStopUser(userHandle);
        }

        @Override
        public void onCleanupUser(int userHandle) {
            synchronized (mService.mCache) {
@@ -162,6 +178,18 @@ public final class ContentService extends IContentService.Stub {
        }
    }

    void onStartUser(int userHandle) {
        if (mSyncManager != null) mSyncManager.onStartUser(userHandle);
    }

    void onUnlockUser(int userHandle) {
        if (mSyncManager != null) mSyncManager.onUnlockUser(userHandle);
    }

    void onStopUser(int userHandle) {
        if (mSyncManager != null) mSyncManager.onStopUser(userHandle);
    }

    @Override
    protected synchronized void dump(FileDescriptor fd, PrintWriter pw_, String[] args) {
        if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw_)) return;
+16 −0
Original line number Diff line number Diff line
@@ -405,6 +405,7 @@ public class SyncManager {
                public void onReceive(Context context, Intent intent) {
                    Log.w(TAG, "Writing sync state before shutdown...");
                    getSyncStorageEngine().writeAllState();
                    mLogger.log("Shutting down.");
                }
            };

@@ -674,8 +675,23 @@ public class SyncManager {
        // before we started checking for account access because they already know
        // the account (they run before) which is the genie is out of the bottle.
        whiteListExistingSyncAdaptersIfNeeded();

        mLogger.log("Sync manager initialized.");
    }

    public void onStartUser(int userHandle) {
        mLogger.log("onStartUser: user=", userHandle);
    }

    public void onUnlockUser(int userHandle) {
        mLogger.log("onUnlockUser: user=", userHandle);
    }

    public void onStopUser(int userHandle) {
        mLogger.log("onStopUser: user=", userHandle);
    }


    private void whiteListExistingSyncAdaptersIfNeeded() {
        if (!mSyncStorageEngine.shouldGrantSyncAdaptersAccountAccess()) {
            return;