- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
79 lines
2.3 KiB
Java
79 lines
2.3 KiB
Java
package com.mbridge.msdk.advanced.view;
|
|
|
|
import android.content.Context;
|
|
import android.content.IntentFilter;
|
|
import com.iab.omid.library.mmadbridge.adsession.AdSession;
|
|
import com.mbridge.msdk.advanced.common.NetWorkStateReceiver;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class MBNativeAdvancedWebview extends WindVaneWebView {
|
|
private static final String e = "MBNativeAdvancedWebview";
|
|
private AdSession f;
|
|
private NetWorkStateReceiver g;
|
|
|
|
public AdSession getAdSession() {
|
|
return this.f;
|
|
}
|
|
|
|
public void setAdSession(AdSession adSession) {
|
|
this.f = adSession;
|
|
}
|
|
|
|
public MBNativeAdvancedWebview(Context context) {
|
|
super(context);
|
|
setBackgroundColor(0);
|
|
}
|
|
|
|
@Override // android.webkit.WebView, android.view.ViewGroup, android.view.View
|
|
public void onAttachedToWindow() {
|
|
super.onAttachedToWindow();
|
|
registerNetWorkReceiver();
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public void onDetachedFromWindow() {
|
|
super.onDetachedFromWindow();
|
|
unregisterNetWorkReceiver();
|
|
}
|
|
|
|
public void registerNetWorkReceiver() {
|
|
try {
|
|
if (this.g == null) {
|
|
this.g = new NetWorkStateReceiver(this);
|
|
}
|
|
IntentFilter intentFilter = new IntentFilter();
|
|
intentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
|
|
getContext().registerReceiver(this.g, intentFilter);
|
|
} catch (Throwable th) {
|
|
af.a(e, th.getMessage());
|
|
}
|
|
}
|
|
|
|
public void unregisterNetWorkReceiver() {
|
|
try {
|
|
NetWorkStateReceiver netWorkStateReceiver = this.g;
|
|
if (netWorkStateReceiver != null) {
|
|
netWorkStateReceiver.a();
|
|
getContext().unregisterReceiver(this.g);
|
|
}
|
|
} catch (Throwable th) {
|
|
af.a(e, th.getMessage());
|
|
}
|
|
}
|
|
|
|
public void finishAdSession() {
|
|
try {
|
|
AdSession adSession = this.f;
|
|
if (adSession != null) {
|
|
adSession.finish();
|
|
this.f = null;
|
|
af.a("OMSDK", "finish adSession");
|
|
}
|
|
} catch (Exception e2) {
|
|
af.a("OMSDK", e2.getMessage());
|
|
}
|
|
}
|
|
}
|