what-the-bank/sources/com/huawei/hms/availableupdate/c.java

42 lines
1.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package com.huawei.hms.availableupdate;
import android.app.Activity;
import com.huawei.hms.support.log.HMSLog;
import java.lang.ref.WeakReference;
/* loaded from: classes2.dex */
public class c {
public static final c b = new c();
private WeakReference<Activity> a;
public boolean a(Activity activity) {
HMSLog.i("UpdateAdapterMgr", "onActivityCreate");
Activity a = a();
if (a != null && !a.isFinishing()) {
activity.finish();
HMSLog.i("UpdateAdapterMgr", "finish one");
return false;
}
this.a = new WeakReference<>(activity);
return true;
}
public void b(Activity activity) {
HMSLog.i("UpdateAdapterMgr", "onActivityDestroy");
Activity a = a();
if (activity == null || !activity.equals(a)) {
return;
}
HMSLog.i("UpdateAdapterMgr", "reset");
this.a = null;
}
private Activity a() {
WeakReference<Activity> weakReference = this.a;
if (weakReference == null) {
return null;
}
return weakReference.get();
}
}