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

Commit c0688301 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Don't store a static instance of UserManager

Otherwise the context within it can't be GCed.
It's better to leave the caching to the ContextImpl.

Bug: 25308506
Change-Id: I9be3ba5b1bb6cdc88b77520b2fbd72d9b72ef30d
parent c8a5e4c1
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -499,14 +499,9 @@ public class UserManager {
    /** @hide */
    public static final int PIN_VERIFICATION_SUCCESS = -1;

    private static UserManager sInstance = null;

    /** @hide */
    public synchronized static UserManager get(Context context) {
        if (sInstance == null) {
            sInstance = (UserManager) context.getSystemService(Context.USER_SERVICE);
        }
        return sInstance;
    public static UserManager get(Context context) {
        return (UserManager) context.getSystemService(Context.USER_SERVICE);
    }

    /** @hide */