package com.parse;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import p137.C2742;

/* JADX INFO: loaded from: classes.dex */
public class ParseAuthenticationManager {
    public final Object lock = new Object();
    public final Map<String, AuthenticationCallback> callbacks = new HashMap();

    public ParseAuthenticationManager(ParseCurrentUserController parseCurrentUserController) {
    }

    public C2742<Void> deauthenticateAsync(String str) {
        final AuthenticationCallback authenticationCallback;
        synchronized (this.lock) {
            authenticationCallback = this.callbacks.get(str);
        }
        return authenticationCallback != null ? C2742.m4802(new Callable<Void>(this) { // from class: com.parse.ParseAuthenticationManager.3
            @Override // java.util.concurrent.Callable
            public Void call() {
                authenticationCallback.onRestore(null);
                return null;
            }
        }, ParseExecutors.io()) : C2742.m4805((Object) null);
    }

    public C2742<Boolean> restoreAuthenticationAsync(String str, final Map<String, String> map) {
        final AuthenticationCallback authenticationCallback;
        synchronized (this.lock) {
            authenticationCallback = this.callbacks.get(str);
        }
        return authenticationCallback == null ? C2742.m4805(true) : C2742.m4802(new Callable<Boolean>(this) { // from class: com.parse.ParseAuthenticationManager.2
            @Override // java.util.concurrent.Callable
            public Boolean call() {
                return Boolean.valueOf(authenticationCallback.onRestore(map));
            }
        }, ParseExecutors.io());
    }
}
