- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
52 lines
1.6 KiB
Java
52 lines
1.6 KiB
Java
package com.helpshift.lifecycle;
|
|
|
|
import android.app.Application;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class HSAppLifeCycleController {
|
|
public static HSAppLifeCycleController instance;
|
|
public BaseLifeCycleTracker lifeCycleTracker;
|
|
|
|
public static HSAppLifeCycleController getInstance() {
|
|
if (instance == null) {
|
|
instance = new HSAppLifeCycleController();
|
|
}
|
|
return instance;
|
|
}
|
|
|
|
public void init(Application application, boolean z, HSAppLifeCycleEventsHandler hSAppLifeCycleEventsHandler) {
|
|
if (this.lifeCycleTracker != null) {
|
|
return;
|
|
}
|
|
if (z) {
|
|
this.lifeCycleTracker = new ManualAppLifeCycleTracker(hSAppLifeCycleEventsHandler);
|
|
} else {
|
|
this.lifeCycleTracker = new DefaultAppLifeCycleTracker(application, hSAppLifeCycleEventsHandler);
|
|
}
|
|
}
|
|
|
|
public void onManualAppForegroundAPI() {
|
|
BaseLifeCycleTracker baseLifeCycleTracker = this.lifeCycleTracker;
|
|
if (baseLifeCycleTracker == null) {
|
|
return;
|
|
}
|
|
baseLifeCycleTracker.onManualAppForegroundAPI();
|
|
}
|
|
|
|
public void onManualAppBackgroundAPI() {
|
|
BaseLifeCycleTracker baseLifeCycleTracker = this.lifeCycleTracker;
|
|
if (baseLifeCycleTracker == null) {
|
|
return;
|
|
}
|
|
baseLifeCycleTracker.onManualAppBackgroundAPI();
|
|
}
|
|
|
|
public void onAppForeground() {
|
|
BaseLifeCycleTracker baseLifeCycleTracker = this.lifeCycleTracker;
|
|
if (baseLifeCycleTracker == null) {
|
|
return;
|
|
}
|
|
baseLifeCycleTracker.notifyAppForeground();
|
|
}
|
|
}
|