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

Commit a74887e8 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Android Git Automerger
Browse files

am 56c4c442: Merge "Lazy initialization must be synchronized to avoid parallel...

am 56c4c442: Merge "Lazy initialization must be synchronized to avoid parallel instances cretation."

* commit '56c4c442':
  Lazy initialization must be synchronized to avoid parallel instances cretation.
parents 9ac9b285 56c4c442
Loading
Loading
Loading
Loading
+22 −18
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ public class CatService extends Handler implements AppInterface {
    private static IccRecords mIccRecords;

    // Service members.
    // Protects singleton instance lazy initialization.
    private static final Object sInstanceLock = new Object();
    private static CatService sInstance;
    private CommandsInterface mCmdIf;
    private Context mContext;
@@ -515,6 +517,7 @@ public class CatService extends Handler implements AppInterface {
     */
    public static CatService getInstance(CommandsInterface ci, IccRecords ir,
            Context context, IccFileHandler fh, IccCard ic) {
        synchronized (sInstanceLock) {
            if (sInstance == null) {
                if (ci == null || ir == null || context == null || fh == null
                        || ic == null) {
@@ -536,6 +539,7 @@ public class CatService extends Handler implements AppInterface {
            }
            return sInstance;
        }
    }

    /**
     * Used by application to get an AppInterface object.