summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xAndroidManifest.xml3
-rw-r--r--src/com/android/nfc/NfcBackupAgent.java33
-rwxr-xr-xsrc/com/android/nfc/NfcService.java2
3 files changed, 37 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index eaf432d..f7ce543 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -22,7 +22,10 @@
android:icon="@drawable/icon"
android:label="@string/app_name"
android:persistent="true"
+ android:backupAgent="com.android.nfc.NfcBackupAgent"
>
+ <meta-data android:name="com.google.android.backup.api_key"
+ android:value="AEdPqrEAAAAIEXGvR1H2lq6SEOC7O7rGHoAmAf-GHCR_EhLqzg" />
<activity android:name="com.android.nfc.TechListChooserActivity"
android:theme="@*android:style/Theme.Dialog.Alert"
diff --git a/src/com/android/nfc/NfcBackupAgent.java b/src/com/android/nfc/NfcBackupAgent.java
new file mode 100644
index 0000000..27fdf76
--- /dev/null
+++ b/src/com/android/nfc/NfcBackupAgent.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+package com.android.nfc;
+
+import android.app.backup.BackupAgentHelper;
+import android.app.backup.SharedPreferencesBackupHelper;
+
+public class NfcBackupAgent extends BackupAgentHelper {
+ // Backup identifier
+ static final String SHARED_PREFS_BACKUP_KEY = "shared_prefs";
+
+ @Override
+ public void onCreate() {
+ SharedPreferencesBackupHelper helper =
+ new SharedPreferencesBackupHelper(this, NfcService.PREF);
+ addHelper(SHARED_PREFS_BACKUP_KEY, helper);
+ }
+}
+
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index e8fb79d..648455c 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -152,7 +152,7 @@ public class NfcService extends Application {
private static final String NFCEE_ADMIN_PERM = NFC_PERM;
private static final String NFCEE_ADMIN_PERM_ERROR = "NFCEE_ADMIN permission required";
- private static final String PREF = "NfcServicePrefs";
+ /*package*/ static final String PREF = "NfcServicePrefs";
private static final String PREF_NFC_ON = "nfc_on";
private static final boolean NFC_ON_DEFAULT = true;