Ruslan Tkhakokhov f9c5bd837c Skip backup/restore of wallpaper package
Do not backup or restore wallpaper package when
'backup_skip_user_facing_data' is set. See https://b.corp.google.com/issues/153940088#comment2 for context.

Bug: 153940088
Test: 1. atest UserBackupManagerServiceTest
      2. atest PerformUnifiedRestoreTaskTest
      3. atest CtsBackupTestCases
      4. atest CtsBackupHostTestCases
      5. Manual:
          1) adb shell settings secure put backup_skip_user_facing_data
	  1
	  2) adb shell bmgr backupnow com.android.wallpaperbackup ->
	  verify skipped
	  3) adb shell bmgr restore 1 com.android.wallpaperbackup ->
	  verify skipped
	  4) adb shell settings secure put backup_skip_user_facing_data
	  0 -> verify com.android.wallpaperbackup is backed up /
	  restored

Change-Id: Iedd0c4030a635e294a04d35bd525ca852c929b92
2020-04-24 09:42:01 +00:00
..
2018-11-13 11:26:43 -08:00
2020-03-13 13:04:13 +00:00

This folder is for Robolectric tests inside the platform.

To add a test class annotate it as follows:

@RunWith(FrameworkRobolectricTestRunner.class)
@Config(manifest = Config.NONE, sdk = 26)
@SystemLoaderClasses({ClassUnderTest.class, DependencyClasses.class})
@SystemLoaderPackages({"com.android.server.yourmodule"})

Robolectric loads some classes that it decides from versioned jars of the framework. Since we are
part of the framework some of our classes get loaded from these jars. This is NOT what we want, we
want to test against what we wrote in the tree. Because of this we use a custom test runner,
FrameworkRobolectricTestRunner, that bypasses these jars and loads certain classes from the system
class loader.

To specify which classes to load use either @SystemLoaderClasses or @SystemLoaderPackages. In
practice:
* You MUST put the class under test here.
* If you encounter any exceptions that might be caused by a different version of the class being
loaded, such as NoSuchMethodException, put the class involved in the exception in this annotation
and try again.

Check Android.mk file for more info.