summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/blocking
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2017-10-26 17:04:30 -0700
committerEric Erfanian <erfanian@google.com>2017-10-27 08:45:56 -0700
commit168d09c3ad4fdc93ab018f68b7f583be7acd2851 (patch)
treece7846c1d1911e2067aeaf42b2e3f247273a43f7 /java/com/android/dialer/blocking
parentf60c5384f34660ae03ae3c15183980dfb8219ba9 (diff)
downloadandroid_packages_apps_Dialer-168d09c3ad4fdc93ab018f68b7f583be7acd2851.tar.gz
android_packages_apps_Dialer-168d09c3ad4fdc93ab018f68b7f583be7acd2851.tar.bz2
android_packages_apps_Dialer-168d09c3ad4fdc93ab018f68b7f583be7acd2851.zip
Move the functionality of DialerUtils#getDefaultSharedPreferenceForDeviceProtectedStorageContext(Context) to StorageComponent.
Bug: 30224215 Test: none PiperOrigin-RevId: 173612463 Change-Id: Ia89d5d85c31ea2114b196393ae43b803023fc9bf
Diffstat (limited to 'java/com/android/dialer/blocking')
-rw-r--r--java/com/android/dialer/blocking/FilteredNumbersUtil.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/java/com/android/dialer/blocking/FilteredNumbersUtil.java b/java/com/android/dialer/blocking/FilteredNumbersUtil.java
index fba3b86db..6433355fd 100644
--- a/java/com/android/dialer/blocking/FilteredNumbersUtil.java
+++ b/java/com/android/dialer/blocking/FilteredNumbersUtil.java
@@ -37,7 +37,7 @@ import com.android.dialer.logging.InteractionEvent;
import com.android.dialer.logging.Logger;
import com.android.dialer.notification.DialerNotificationManager;
import com.android.dialer.notification.NotificationChannelId;
-import com.android.dialer.util.DialerUtils;
+import com.android.dialer.storage.StorageComponent;
import com.android.dialer.util.PermissionsUtil;
import java.util.concurrent.TimeUnit;
@@ -187,7 +187,8 @@ public class FilteredNumbersUtil {
}
public static long getLastEmergencyCallTimeMillis(Context context) {
- return DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
+ return StorageComponent.get(context)
+ .unencryptedSharedPrefs()
.getLong(LAST_EMERGENCY_CALL_MS_PREF_KEY, 0);
}
@@ -210,7 +211,8 @@ public class FilteredNumbersUtil {
return;
}
- DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
+ StorageComponent.get(context)
+ .unencryptedSharedPrefs()
.edit()
.putLong(LAST_EMERGENCY_CALL_MS_PREF_KEY, System.currentTimeMillis())
.putBoolean(NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY, false)
@@ -227,7 +229,8 @@ public class FilteredNumbersUtil {
return;
}
// Skip if the user has already received a notification for the most recent emergency call.
- if (DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
+ if (StorageComponent.get(context)
+ .unencryptedSharedPrefs()
.getBoolean(NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY, false)) {
return;
}
@@ -268,7 +271,8 @@ public class FilteredNumbersUtil {
builder.build());
// Record that the user has been notified for this emergency call.
- DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
+ StorageComponent.get(context)
+ .unencryptedSharedPrefs()
.edit()
.putBoolean(NOTIFIED_CALL_BLOCKING_DISABLED_BY_EMERGENCY_CALL_PREF_KEY, true)
.apply();