android.app.backup.BackupAgent Java Examples

The following examples show how to use android.app.backup.BackupAgent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActivityThread.java    From AndroidComponentPlugin with Apache License 2.0 6 votes vote down vote up
private void handleDestroyBackupAgent(CreateBackupAgentData data) {
    if (DEBUG_BACKUP) Slog.v(TAG, "handleDestroyBackupAgent: " + data);

    LoadedApk packageInfo = getPackageInfoNoCheck(data.appInfo, data.compatInfo);
    String packageName = packageInfo.mPackageName;
    BackupAgent agent = mBackupAgents.get(packageName);
    if (agent != null) {
        try {
            agent.onDestroy();
        } catch (Exception e) {
            Slog.w(TAG, "Exception thrown in onDestroy by backup agent of " + data.appInfo);
            e.printStackTrace();
        }
        mBackupAgents.remove(packageName);
    } else {
        Slog.w(TAG, "Attempt to destroy unknown backup agent " + data);
    }
}
 
Example #2
Source File: ActivityThread.java    From AndroidComponentPlugin with Apache License 2.0 6 votes vote down vote up
private void handleDestroyBackupAgent(CreateBackupAgentData data) {
    if (DEBUG_BACKUP) Slog.v(TAG, "handleDestroyBackupAgent: " + data);

    LoadedApk packageInfo = getPackageInfoNoCheck(data.appInfo, data.compatInfo);
    String packageName = packageInfo.mPackageName;
    BackupAgent agent = mBackupAgents.get(packageName);
    if (agent != null) {
        try {
            agent.onDestroy();
        } catch (Exception e) {
            Slog.w(TAG, "Exception thrown in onDestroy by backup agent of " + data.appInfo);
            e.printStackTrace();
        }
        mBackupAgents.remove(packageName);
    } else {
        Slog.w(TAG, "Attempt to destroy unknown backup agent " + data);
    }
}