Loading services/backup/java/com/android/server/backup/BackupManagerService.java +1 −8 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.os.Binder; import android.os.HandlerThread; import android.os.IBinder; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.Trace; import android.os.UserHandle; import android.util.Slog; Loading Loading @@ -139,13 +138,7 @@ public class BackupManagerService { mServiceUsers.put(userId, userBackupManagerService); Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "backup enable"); try { // TODO(b/121198604): Make enable file per-user and clean up indirection. mTrampoline.setBackupEnabledForUser( userId, UserBackupManagerFilePersistedSettings.readBackupEnableState(userId)); } catch (RemoteException e) { // Can't happen, it's a local object. } userBackupManagerService.initializeBackupEnableState(); Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } Loading services/backup/java/com/android/server/backup/UserBackupManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -556,6 +556,11 @@ public class UserBackupManagerService { mWakelock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*backup*"); } void initializeBackupEnableState() { boolean isEnabled = UserBackupManagerFilePersistedSettings.readBackupEnableState(mUserId); setBackupEnabled(isEnabled); } /** Cleans up state when the user of this service is stopped. */ void tearDownService() { mUserBackupThread.quit(); Loading services/backup/java/com/android/server/backup/internal/SetupObserver.java +1 −1 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading services/robotests/backup/src/com/android/server/backup/BackupManagerServiceTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.backup; import static android.Manifest.permission.BACKUP; import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static com.android.server.backup.testing.BackupManagerServiceTestUtils.startBackupThread; Loading @@ -27,7 +28,6 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.robolectric.Shadows.shadowOf; import static org.testng.Assert.expectThrows; Loading Loading @@ -201,7 +201,7 @@ public class BackupManagerServiceTest { backupManagerService.stopServiceForUser(mUserOneId); verify(mUserOneService).tearDownService(); verifyNoMoreInteractions(mUserTwoService); verify(mUserTwoService, never()).tearDownService(); } /** Test that the service unregisters users when stopped. */ Loading Loading @@ -1542,6 +1542,7 @@ public class BackupManagerServiceTest { } private BackupManagerService createService() { mShadowContext.grantPermissions(BACKUP); return new BackupManagerService( mContext, new Trampoline(mContext), startBackupThread(null)); } Loading services/robotests/backup/src/com/android/server/backup/internal/SetupObserverTest.java +1 −1 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +1 −8 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.os.Binder; import android.os.HandlerThread; import android.os.IBinder; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.Trace; import android.os.UserHandle; import android.util.Slog; Loading Loading @@ -139,13 +138,7 @@ public class BackupManagerService { mServiceUsers.put(userId, userBackupManagerService); Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "backup enable"); try { // TODO(b/121198604): Make enable file per-user and clean up indirection. mTrampoline.setBackupEnabledForUser( userId, UserBackupManagerFilePersistedSettings.readBackupEnableState(userId)); } catch (RemoteException e) { // Can't happen, it's a local object. } userBackupManagerService.initializeBackupEnableState(); Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } Loading
services/backup/java/com/android/server/backup/UserBackupManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -556,6 +556,11 @@ public class UserBackupManagerService { mWakelock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*backup*"); } void initializeBackupEnableState() { boolean isEnabled = UserBackupManagerFilePersistedSettings.readBackupEnableState(mUserId); setBackupEnabled(isEnabled); } /** Cleans up state when the user of this service is stopped. */ void tearDownService() { mUserBackupThread.quit(); Loading
services/backup/java/com/android/server/backup/internal/SetupObserver.java +1 −1 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading
services/robotests/backup/src/com/android/server/backup/BackupManagerServiceTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.backup; import static android.Manifest.permission.BACKUP; import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static com.android.server.backup.testing.BackupManagerServiceTestUtils.startBackupThread; Loading @@ -27,7 +28,6 @@ import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.robolectric.Shadows.shadowOf; import static org.testng.Assert.expectThrows; Loading Loading @@ -201,7 +201,7 @@ public class BackupManagerServiceTest { backupManagerService.stopServiceForUser(mUserOneId); verify(mUserOneService).tearDownService(); verifyNoMoreInteractions(mUserTwoService); verify(mUserTwoService, never()).tearDownService(); } /** Test that the service unregisters users when stopped. */ Loading Loading @@ -1542,6 +1542,7 @@ public class BackupManagerServiceTest { } private BackupManagerService createService() { mShadowContext.grantPermissions(BACKUP); return new BackupManagerService( mContext, new Trampoline(mContext), startBackupThread(null)); } Loading
services/robotests/backup/src/com/android/server/backup/internal/SetupObserverTest.java +1 −1 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading