101 lines
2.5 KiB
Java
101 lines
2.5 KiB
Java
package com.huawei.hms.ui;
|
|
|
|
import android.os.Bundle;
|
|
import com.huawei.hms.base.ui.LogUtil;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class SafeBundle {
|
|
private final Bundle a;
|
|
|
|
public SafeBundle() {
|
|
this(new Bundle());
|
|
}
|
|
|
|
public boolean containsKey(String str) {
|
|
try {
|
|
return this.a.containsKey(str);
|
|
} catch (Throwable unused) {
|
|
LogUtil.e("SafeBundle", "containsKey exception. key:");
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public Object get(String str) {
|
|
try {
|
|
return this.a.get(str);
|
|
} catch (Exception e) {
|
|
StringBuilder sb = new StringBuilder("get exception: ");
|
|
sb.append(e.getMessage());
|
|
LogUtil.e("SafeBundle", sb.toString(), true);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public int getInt(String str) {
|
|
return getInt(str, 0);
|
|
}
|
|
|
|
public String getString(String str) {
|
|
try {
|
|
return this.a.getString(str);
|
|
} catch (Throwable th) {
|
|
StringBuilder sb = new StringBuilder("getString exception: ");
|
|
sb.append(th.getMessage());
|
|
LogUtil.e("SafeBundle", sb.toString(), true);
|
|
return "";
|
|
}
|
|
}
|
|
|
|
public boolean isEmpty() {
|
|
try {
|
|
return this.a.isEmpty();
|
|
} catch (Exception unused) {
|
|
LogUtil.e("SafeBundle", "isEmpty exception");
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public int size() {
|
|
try {
|
|
return this.a.size();
|
|
} catch (Exception unused) {
|
|
LogUtil.e("SafeBundle", "size exception");
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
public String toString() {
|
|
return this.a.toString();
|
|
}
|
|
|
|
public SafeBundle(Bundle bundle) {
|
|
this.a = bundle == null ? new Bundle() : bundle;
|
|
}
|
|
|
|
public int getInt(String str, int i) {
|
|
try {
|
|
return this.a.getInt(str, i);
|
|
} catch (Throwable th) {
|
|
StringBuilder sb = new StringBuilder("getInt exception: ");
|
|
sb.append(th.getMessage());
|
|
LogUtil.e("SafeBundle", sb.toString(), true);
|
|
return i;
|
|
}
|
|
}
|
|
|
|
public String getString(String str, String str2) {
|
|
try {
|
|
return this.a.getString(str, str2);
|
|
} catch (Exception e) {
|
|
StringBuilder sb = new StringBuilder("getString exception: ");
|
|
sb.append(e.getMessage());
|
|
LogUtil.e("SafeBundle", sb.toString(), true);
|
|
return str2;
|
|
}
|
|
}
|
|
|
|
public Bundle getBundle() {
|
|
return this.a;
|
|
}
|
|
}
|