Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d0de310 authored by Tommy Webb's avatar Tommy Webb Committed by Chirayu Desai
Browse files

DeskClock: Enable backup

* Set allowBackup to true.
* Properly support device-to-device migrations (D2D) in addition to
  normal backups by switching to dataExtractionRules.
* Include the files correctly using the device-encrypted domains,
  which is where they are stored now for access in Direct Boot.

Change-Id: I1321da4b2250d083c8785386af5ba096cd0e05eb
parent 973abea4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -39,9 +39,9 @@

    <application
        android:name=".DeskClockApplication"
        android:allowBackup="false"
        android:allowBackup="true"
        android:backupAgent="DeskClockBackupAgent"
        android:fullBackupContent="@xml/backup_scheme"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupOnly="true"
        android:appCategory="productivity"
        android:icon="@mipmap/ic_launcher"

res/xml/backup_scheme.xml

deleted100644 → 0
+0 −20
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<full-backup-content>
    <include domain="database" path="alarms.db" />
    <include domain="sharedpref" path="com.android.deskclock_preferences.xml" />
</full-backup-content>
+17 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  SPDX-FileCopyrightText: 2023 The Calyx Institute
  SPDX-License-Identifier: Apache-2.0
  -->
<data-extraction-rules>
    <cloud-backup>
        <!-- use "device_" domains; these files are stored in device-encrypted storage (user_de) -->
        <include domain="device_database" path="alarms.db" />
        <include domain="device_sharedpref" path="com.android.deskclock_preferences.xml" />
    </cloud-backup>
    <device-transfer>
        <!-- use "device_" domains; these files are stored in device-encrypted storage (user_de) -->
        <include domain="device_database" path="alarms.db" />
        <include domain="device_sharedpref" path="com.android.deskclock_preferences.xml" />
    </device-transfer>
</data-extraction-rules>