Add backup/restore support

We use the new fullContentBackup feature introduced in M. The
wrinkle that exists in our case is that the preference file
could be either:

com.android.deskclock_preferences.xml
or
com.google.android.deskclock_preferences.xml

depending on whether DeskClockGoogle overlayed DeskClock or
came as part of the device image.

So, a BackupAgent is also configured and used to intercept the
writing of the preference file on the restore device. The
preference filename is then altered to include the package name
of the receiving application, guaranteeing that the preferences
(which store world clocks, timers and stopwatch data) survive
intact.

Bug: 21818176
Change-Id: Ie4652ef8375b8db4ab6e2ae3dc40820dae618ddf
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4825e5b..9d1d0db 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -35,6 +35,10 @@
 
     <application android:label="@string/app_label"
                  android:name=".DeskClockApplication"
+                 android:allowBackup="true"
+                 android:backupAgent="DeskClockBackupAgent"
+                 android:fullBackupContent="@xml/backup_scheme"
+                 android:fullBackupOnly="true"
                  android:icon="@mipmap/ic_launcher_alarmclock"
                  android:requiredForAllUsers="true"
                  android:supportsRtl="true">
@@ -47,8 +51,7 @@
                 android:label="@string/app_label"
                 android:theme="@style/DeskClock"
                 android:icon="@mipmap/ic_launcher_alarmclock"
-                android:launchMode="singleTask"
-                >
+                android:launchMode="singleTask">
 
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />