30 lines
768 B
Java
30 lines
768 B
Java
|
package com.huawei.hms.availableupdate;
|
||
|
|
||
|
import android.app.Activity;
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.List;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public class b {
|
||
|
public static final b b = new b();
|
||
|
private static final Object c = new Object();
|
||
|
private final List<Activity> a = new ArrayList(1);
|
||
|
|
||
|
public void a(Activity activity) {
|
||
|
synchronized (c) {
|
||
|
for (Activity activity2 : this.a) {
|
||
|
if (activity2 != null && activity2 != activity && !activity2.isFinishing()) {
|
||
|
activity2.finish();
|
||
|
}
|
||
|
}
|
||
|
this.a.add(activity);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public void b(Activity activity) {
|
||
|
synchronized (c) {
|
||
|
this.a.remove(activity);
|
||
|
}
|
||
|
}
|
||
|
}
|