73 lines
1.9 KiB
Java
73 lines
1.9 KiB
Java
package com.facebook;
|
|
|
|
import android.content.Intent;
|
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|
import com.facebook.internal.Utility;
|
|
import com.facebook.internal.Validate;
|
|
|
|
/* loaded from: classes.dex */
|
|
final class ProfileManager {
|
|
private static volatile ProfileManager d;
|
|
private final LocalBroadcastManager a;
|
|
private final ProfileCache b;
|
|
private Profile c;
|
|
|
|
ProfileManager(LocalBroadcastManager localBroadcastManager, ProfileCache profileCache) {
|
|
Validate.a(localBroadcastManager, "localBroadcastManager");
|
|
Validate.a(profileCache, "profileCache");
|
|
this.a = localBroadcastManager;
|
|
this.b = profileCache;
|
|
}
|
|
|
|
static ProfileManager c() {
|
|
if (d == null) {
|
|
synchronized (ProfileManager.class) {
|
|
if (d == null) {
|
|
d = new ProfileManager(LocalBroadcastManager.a(FacebookSdk.b()), new ProfileCache());
|
|
}
|
|
}
|
|
}
|
|
return d;
|
|
}
|
|
|
|
Profile a() {
|
|
return this.c;
|
|
}
|
|
|
|
boolean b() {
|
|
Profile b = this.b.b();
|
|
if (b == null) {
|
|
return false;
|
|
}
|
|
a(b, false);
|
|
return true;
|
|
}
|
|
|
|
void a(Profile profile) {
|
|
a(profile, true);
|
|
}
|
|
|
|
private void a(Profile profile, boolean z) {
|
|
Profile profile2 = this.c;
|
|
this.c = profile;
|
|
if (z) {
|
|
if (profile != null) {
|
|
this.b.a(profile);
|
|
} else {
|
|
this.b.a();
|
|
}
|
|
}
|
|
if (Utility.a(profile2, profile)) {
|
|
return;
|
|
}
|
|
a(profile2, profile);
|
|
}
|
|
|
|
private void a(Profile profile, Profile profile2) {
|
|
Intent intent = new Intent("com.facebook.sdk.ACTION_CURRENT_PROFILE_CHANGED");
|
|
intent.putExtra("com.facebook.sdk.EXTRA_OLD_PROFILE", profile);
|
|
intent.putExtra("com.facebook.sdk.EXTRA_NEW_PROFILE", profile2);
|
|
this.a.a(intent);
|
|
}
|
|
}
|