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

am: 09e1fae73f

Change-Id: If7c7fe80a450d0151efeb2ea26e7bfedd6a4a04f
This commit is contained in:
Makoto Onuki
2017-06-30 00:19:06 +00:00
committed by android-build-merger
2 changed files with 44 additions and 0 deletions

View File

@@ -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 @Override
public void onCleanupUser(int userHandle) { public void onCleanupUser(int userHandle) {
synchronized (mService.mCache) { 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 @Override
protected synchronized void dump(FileDescriptor fd, PrintWriter pw_, String[] args) { protected synchronized void dump(FileDescriptor fd, PrintWriter pw_, String[] args) {
if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw_)) return; if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw_)) return;

View File

@@ -405,6 +405,7 @@ public class SyncManager {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Log.w(TAG, "Writing sync state before shutdown..."); Log.w(TAG, "Writing sync state before shutdown...");
getSyncStorageEngine().writeAllState(); getSyncStorageEngine().writeAllState();
mLogger.log("Shutting down.");
} }
}; };
@@ -674,8 +675,23 @@ public class SyncManager {
// before we started checking for account access because they already know // 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. // the account (they run before) which is the genie is out of the bottle.
whiteListExistingSyncAdaptersIfNeeded(); 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() { private void whiteListExistingSyncAdaptersIfNeeded() {
if (!mSyncStorageEngine.shouldGrantSyncAdaptersAccountAccess()) { if (!mSyncStorageEngine.shouldGrantSyncAdaptersAccountAccess()) {
return; return;