summaryrefslogtreecommitdiff
path: root/src/com/android/deskclock/DeskClockApplication.java
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2022-03-18 20:23:26 +0100
committerMichael W <baddaemon87@gmail.com>2022-04-18 10:03:08 +0200
commitfa6047db25729eebf26826f738d4a4ab2327a512 (patch)
treee94535bf44d25673adbf26f9262c5a56413f8280 /src/com/android/deskclock/DeskClockApplication.java
parent23d7064d1abf2feb41d3d1a1812038a26e836181 (diff)
DeskClock: Remove compatibility to old APIsHEADsugisawa-mr1
* We never build on these, so the code and annotations are useless Change-Id: I791370b531ecadcbddb63ca04d5c4c51aafe1bc1
Diffstat (limited to 'src/com/android/deskclock/DeskClockApplication.java')
-rw-r--r--src/com/android/deskclock/DeskClockApplication.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/com/android/deskclock/DeskClockApplication.java b/src/com/android/deskclock/DeskClockApplication.java
index 395d38518..784bc6f1d 100644
--- a/src/com/android/deskclock/DeskClockApplication.java
+++ b/src/com/android/deskclock/DeskClockApplication.java
@@ -16,7 +16,6 @@
package com.android.deskclock;
-import android.annotation.TargetApi;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
@@ -46,20 +45,17 @@ public class DeskClockApplication extends Application {
/**
* Returns the default {@link SharedPreferences} instance from the underlying storage context.
*/
- @TargetApi(Build.VERSION_CODES.N)
private static SharedPreferences getDefaultSharedPreferences(Context context) {
final Context storageContext;
- if (Utils.isNOrLater()) {
- // All N devices have split storage areas. Migrate the existing preferences into the new
- // device encrypted storage area if that has not yet occurred.
- final String name = PreferenceManager.getDefaultSharedPreferencesName(context);
- storageContext = context.createDeviceProtectedStorageContext();
- if (!storageContext.moveSharedPreferencesFrom(context, name)) {
- LogUtils.wtf("Failed to migrate shared preferences");
- }
- } else {
- storageContext = context;
+
+ // All N devices have split storage areas. Migrate the existing preferences into the new
+ // device encrypted storage area if that has not yet occurred.
+ final String name = PreferenceManager.getDefaultSharedPreferencesName(context);
+ storageContext = context.createDeviceProtectedStorageContext();
+ if (!storageContext.moveSharedPreferencesFrom(context, name)) {
+ LogUtils.wtf("Failed to migrate shared preferences");
}
+
return PreferenceManager.getDefaultSharedPreferences(storageContext);
}
-} \ No newline at end of file
+}