Initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package androidx.browser.customtabs;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CustomTabsCallback {
|
||||
}
|
69
sources/androidx/browser/customtabs/CustomTabsIntent.java
Normal file
69
sources/androidx/browser/customtabs/CustomTabsIntent.java
Normal file
@@ -0,0 +1,69 @@
|
||||
package androidx.browser.customtabs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import androidx.core.app.BundleCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class CustomTabsIntent {
|
||||
public final Intent a;
|
||||
public final Bundle b;
|
||||
|
||||
public static final class Builder {
|
||||
private final Intent a;
|
||||
private ArrayList<Bundle> b;
|
||||
private Bundle c;
|
||||
private ArrayList<Bundle> d;
|
||||
private boolean e;
|
||||
|
||||
public Builder() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public CustomTabsIntent a() {
|
||||
ArrayList<Bundle> arrayList = this.b;
|
||||
if (arrayList != null) {
|
||||
this.a.putParcelableArrayListExtra("android.support.customtabs.extra.MENU_ITEMS", arrayList);
|
||||
}
|
||||
ArrayList<Bundle> arrayList2 = this.d;
|
||||
if (arrayList2 != null) {
|
||||
this.a.putParcelableArrayListExtra("android.support.customtabs.extra.TOOLBAR_ITEMS", arrayList2);
|
||||
}
|
||||
this.a.putExtra("android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS", this.e);
|
||||
return new CustomTabsIntent(this.a, this.c);
|
||||
}
|
||||
|
||||
public Builder(CustomTabsSession customTabsSession) {
|
||||
this.a = new Intent("android.intent.action.VIEW");
|
||||
this.b = null;
|
||||
this.c = null;
|
||||
this.d = null;
|
||||
this.e = true;
|
||||
if (customTabsSession != null) {
|
||||
customTabsSession.b();
|
||||
throw null;
|
||||
}
|
||||
Bundle bundle = new Bundle();
|
||||
if (customTabsSession != null) {
|
||||
customTabsSession.a();
|
||||
throw null;
|
||||
}
|
||||
BundleCompat.a(bundle, "android.support.customtabs.extra.SESSION", null);
|
||||
this.a.putExtras(bundle);
|
||||
}
|
||||
}
|
||||
|
||||
CustomTabsIntent(Intent intent, Bundle bundle) {
|
||||
this.a = intent;
|
||||
this.b = bundle;
|
||||
}
|
||||
|
||||
public void a(Context context, Uri uri) {
|
||||
this.a.setData(uri);
|
||||
ContextCompat.a(context, this.a, this.b);
|
||||
}
|
||||
}
|
109
sources/androidx/browser/customtabs/CustomTabsService.java
Normal file
109
sources/androidx/browser/customtabs/CustomTabsService.java
Normal file
@@ -0,0 +1,109 @@
|
||||
package androidx.browser.customtabs;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.support.customtabs.ICustomTabsCallback;
|
||||
import android.support.customtabs.ICustomTabsService;
|
||||
import androidx.collection.ArrayMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class CustomTabsService extends Service {
|
||||
final Map<IBinder, IBinder.DeathRecipient> a = new ArrayMap();
|
||||
private ICustomTabsService.Stub b = new ICustomTabsService.Stub() { // from class: androidx.browser.customtabs.CustomTabsService.1
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public boolean a(long j) {
|
||||
return CustomTabsService.this.a(j);
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public Bundle b(String str, Bundle bundle) {
|
||||
return CustomTabsService.this.a(str, bundle);
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public boolean a(ICustomTabsCallback iCustomTabsCallback) {
|
||||
final CustomTabsSessionToken customTabsSessionToken = new CustomTabsSessionToken(iCustomTabsCallback);
|
||||
try {
|
||||
IBinder.DeathRecipient deathRecipient = new IBinder.DeathRecipient() { // from class: androidx.browser.customtabs.CustomTabsService.1.1
|
||||
@Override // android.os.IBinder.DeathRecipient
|
||||
public void binderDied() {
|
||||
CustomTabsService.this.a(customTabsSessionToken);
|
||||
}
|
||||
};
|
||||
synchronized (CustomTabsService.this.a) {
|
||||
iCustomTabsCallback.asBinder().linkToDeath(deathRecipient, 0);
|
||||
CustomTabsService.this.a.put(iCustomTabsCallback.asBinder(), deathRecipient);
|
||||
}
|
||||
return CustomTabsService.this.b(customTabsSessionToken);
|
||||
} catch (RemoteException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public boolean b(ICustomTabsCallback iCustomTabsCallback, Bundle bundle) {
|
||||
return CustomTabsService.this.a(new CustomTabsSessionToken(iCustomTabsCallback), bundle);
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public int b(ICustomTabsCallback iCustomTabsCallback, String str, Bundle bundle) {
|
||||
return CustomTabsService.this.a(new CustomTabsSessionToken(iCustomTabsCallback), str, bundle);
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public boolean a(ICustomTabsCallback iCustomTabsCallback, Uri uri, Bundle bundle, List<Bundle> list) {
|
||||
return CustomTabsService.this.a(new CustomTabsSessionToken(iCustomTabsCallback), uri, bundle, list);
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public boolean a(ICustomTabsCallback iCustomTabsCallback, Uri uri) {
|
||||
return CustomTabsService.this.a(new CustomTabsSessionToken(iCustomTabsCallback), uri);
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsService
|
||||
public boolean a(ICustomTabsCallback iCustomTabsCallback, int i, Uri uri, Bundle bundle) {
|
||||
return CustomTabsService.this.a(new CustomTabsSessionToken(iCustomTabsCallback), i, uri, bundle);
|
||||
}
|
||||
};
|
||||
|
||||
protected abstract int a(CustomTabsSessionToken customTabsSessionToken, String str, Bundle bundle);
|
||||
|
||||
protected abstract Bundle a(String str, Bundle bundle);
|
||||
|
||||
protected abstract boolean a(long j);
|
||||
|
||||
protected boolean a(CustomTabsSessionToken customTabsSessionToken) {
|
||||
try {
|
||||
synchronized (this.a) {
|
||||
IBinder a = customTabsSessionToken.a();
|
||||
a.unlinkToDeath(this.a.get(a), 0);
|
||||
this.a.remove(a);
|
||||
}
|
||||
return true;
|
||||
} catch (NoSuchElementException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean a(CustomTabsSessionToken customTabsSessionToken, int i, Uri uri, Bundle bundle);
|
||||
|
||||
protected abstract boolean a(CustomTabsSessionToken customTabsSessionToken, Uri uri);
|
||||
|
||||
protected abstract boolean a(CustomTabsSessionToken customTabsSessionToken, Uri uri, Bundle bundle, List<Bundle> list);
|
||||
|
||||
protected abstract boolean a(CustomTabsSessionToken customTabsSessionToken, Bundle bundle);
|
||||
|
||||
protected abstract boolean b(CustomTabsSessionToken customTabsSessionToken);
|
||||
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
return this.b;
|
||||
}
|
||||
}
|
15
sources/androidx/browser/customtabs/CustomTabsSession.java
Normal file
15
sources/androidx/browser/customtabs/CustomTabsSession.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package androidx.browser.customtabs;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.os.IBinder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class CustomTabsSession {
|
||||
IBinder a() {
|
||||
throw null;
|
||||
}
|
||||
|
||||
ComponentName b() {
|
||||
throw null;
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package androidx.browser.customtabs;
|
||||
|
||||
import android.os.IBinder;
|
||||
import android.support.customtabs.ICustomTabsCallback;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class CustomTabsSessionToken {
|
||||
final ICustomTabsCallback a;
|
||||
|
||||
CustomTabsSessionToken(ICustomTabsCallback iCustomTabsCallback) {
|
||||
this.a = iCustomTabsCallback;
|
||||
new CustomTabsCallback(this) { // from class: androidx.browser.customtabs.CustomTabsSessionToken.1
|
||||
};
|
||||
}
|
||||
|
||||
IBinder a() {
|
||||
return this.a.asBinder();
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof CustomTabsSessionToken) {
|
||||
return ((CustomTabsSessionToken) obj).a().equals(this.a.asBinder());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return a().hashCode();
|
||||
}
|
||||
}
|
29
sources/androidx/browser/customtabs/PostMessageService.java
Normal file
29
sources/androidx/browser/customtabs/PostMessageService.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package androidx.browser.customtabs;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.support.customtabs.ICustomTabsCallback;
|
||||
import android.support.customtabs.IPostMessageService;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class PostMessageService extends Service {
|
||||
private IPostMessageService.Stub a = new IPostMessageService.Stub(this) { // from class: androidx.browser.customtabs.PostMessageService.1
|
||||
@Override // android.support.customtabs.IPostMessageService
|
||||
public void a(ICustomTabsCallback iCustomTabsCallback, Bundle bundle) throws RemoteException {
|
||||
iCustomTabsCallback.b(bundle);
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.IPostMessageService
|
||||
public void a(ICustomTabsCallback iCustomTabsCallback, String str, Bundle bundle) throws RemoteException {
|
||||
iCustomTabsCallback.a(str, bundle);
|
||||
}
|
||||
};
|
||||
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
return this.a;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user