summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-08-21 16:23:44 (GMT)
committerSunny Goyal <sunnygoyal@google.com>2015-08-21 16:24:01 (GMT)
commitad0c2f28ceb750646e0132a01d393f5115cbfca9 (patch)
tree40e140282b67a86f473248de337e99e5b8fe86e4
parent81c5f7e39727085e1a8915cc36e9cbf2bb085890 (diff)
downloadandroid_packages_apps_Trebuchet-ad0c2f28ceb750646e0132a01d393f5115cbfca9.zip
android_packages_apps_Trebuchet-ad0c2f28ceb750646e0132a01d393f5115cbfca9.tar.gz
android_packages_apps_Trebuchet-ad0c2f28ceb750646e0132a01d393f5115cbfca9.tar.bz2
Using the usermanager api to get creation time
Bug: 22539048 Change-Id: I17647f2456434ca66a9778300e1a2910cec171d4
-rw-r--r--src/com/android/launcher3/compat/UserManagerCompatVL.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher3/compat/UserManagerCompatVL.java b/src/com/android/launcher3/compat/UserManagerCompatVL.java
index 4d404db..dc3ec3c 100644
--- a/src/com/android/launcher3/compat/UserManagerCompatVL.java
+++ b/src/com/android/launcher3/compat/UserManagerCompatVL.java
@@ -26,6 +26,7 @@ import android.os.Build;
import android.os.UserHandle;
import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.Utilities;
import com.android.launcher3.util.LongArrayMap;
import java.util.ArrayList;
@@ -100,7 +101,9 @@ public class UserManagerCompatVL extends UserManagerCompatV17 {
@Override
public long getUserCreationTime(UserHandleCompat user) {
- // TODO: Use system API once available.
+ if (Utilities.ATLEAST_MARSHMALLOW) {
+ return mUserManager.getUserCreationTime(user.getUser());
+ }
SharedPreferences prefs = mContext.getSharedPreferences(
LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE);
String key = USER_CREATION_TIME_KEY + getSerialNumberForUser(user);