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

Commit ad0c2f28 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Using the usermanager api to get creation time

Bug: 22539048
Change-Id: I17647f2456434ca66a9778300e1a2910cec171d4
parent 81c5f7e3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);