Loading services/backup/java/com/android/server/backup/UserBackupManagerService.java +9 −11 Original line number Diff line number Diff line Loading @@ -494,20 +494,18 @@ public class UserBackupManagerService { mUserId); mBaseStateDir = checkNotNull(baseStateDir, "baseStateDir cannot be null"); // TODO (b/120424138): Remove once the system user is migrated to use the per-user CE // directory. Per-user CE directories are managed by vold. if (userId == UserHandle.USER_SYSTEM) { mBaseStateDir.mkdirs(); if (!SELinux.restoreconRecursive(mBaseStateDir)) { if (!SELinux.restorecon(mBaseStateDir)) { Slog.w(TAG, "SELinux restorecon failed on " + mBaseStateDir); } } // TODO (b/120424138): The system user currently uses the cache which is managed by init.rc // Initialization and restorecon is managed by vold for per-user CE directories. mDataDir = checkNotNull(dataDir, "dataDir cannot be null"); // TODO(b/120424138): Remove when the system user moves out of the cache dir. The cache dir // is managed by init.rc so we don't have to create it below. if (userId != UserHandle.USER_SYSTEM) { mDataDir.mkdirs(); if (!SELinux.restoreconRecursive(mDataDir)) { Slog.w(TAG, "SELinux restorecon failed on " + mDataDir); } } mBackupPasswordManager = new BackupPasswordManager(mContext, mBaseStateDir, mRng); // Receivers for scheduled backups and transport initialization operations. Loading services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupTask.java +7 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.SELinux; import android.os.UserHandle; import android.os.WorkSource; import com.android.internal.annotations.GuardedBy; Loading Loading @@ -686,9 +687,13 @@ public class KeyValueBackupTask implements BackupRestoreTask, Runnable { ParcelFileDescriptor.open( mNewStateFile, MODE_READ_WRITE | MODE_CREATE | MODE_TRUNCATE); // TODO (b/120424138): Remove once the system user is migrated to use the per-user CE // directory. Per-user CE directories are managed by vold. if (mUserId == UserHandle.USER_SYSTEM) { if (!SELinux.restorecon(mBackupDataFile)) { mReporter.onRestoreconFailed(mBackupDataFile); } } IBackupTransport transport = mTransportClient.connectOrThrow("KVBT.extractAgentData()"); long quota = transport.getBackupQuota(packageName, /* isFullBackup */ false); Loading Loading
services/backup/java/com/android/server/backup/UserBackupManagerService.java +9 −11 Original line number Diff line number Diff line Loading @@ -494,20 +494,18 @@ public class UserBackupManagerService { mUserId); mBaseStateDir = checkNotNull(baseStateDir, "baseStateDir cannot be null"); // TODO (b/120424138): Remove once the system user is migrated to use the per-user CE // directory. Per-user CE directories are managed by vold. if (userId == UserHandle.USER_SYSTEM) { mBaseStateDir.mkdirs(); if (!SELinux.restoreconRecursive(mBaseStateDir)) { if (!SELinux.restorecon(mBaseStateDir)) { Slog.w(TAG, "SELinux restorecon failed on " + mBaseStateDir); } } // TODO (b/120424138): The system user currently uses the cache which is managed by init.rc // Initialization and restorecon is managed by vold for per-user CE directories. mDataDir = checkNotNull(dataDir, "dataDir cannot be null"); // TODO(b/120424138): Remove when the system user moves out of the cache dir. The cache dir // is managed by init.rc so we don't have to create it below. if (userId != UserHandle.USER_SYSTEM) { mDataDir.mkdirs(); if (!SELinux.restoreconRecursive(mDataDir)) { Slog.w(TAG, "SELinux restorecon failed on " + mDataDir); } } mBackupPasswordManager = new BackupPasswordManager(mContext, mBaseStateDir, mRng); // Receivers for scheduled backups and transport initialization operations. Loading
services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupTask.java +7 −2 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.SELinux; import android.os.UserHandle; import android.os.WorkSource; import com.android.internal.annotations.GuardedBy; Loading Loading @@ -686,9 +687,13 @@ public class KeyValueBackupTask implements BackupRestoreTask, Runnable { ParcelFileDescriptor.open( mNewStateFile, MODE_READ_WRITE | MODE_CREATE | MODE_TRUNCATE); // TODO (b/120424138): Remove once the system user is migrated to use the per-user CE // directory. Per-user CE directories are managed by vold. if (mUserId == UserHandle.USER_SYSTEM) { if (!SELinux.restorecon(mBackupDataFile)) { mReporter.onRestoreconFailed(mBackupDataFile); } } IBackupTransport transport = mTransportClient.connectOrThrow("KVBT.extractAgentData()"); long quota = transport.getBackupQuota(packageName, /* isFullBackup */ false); Loading