Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom tabs in more browsers #6705

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.browser.customtabs.CustomTabsClient;
import androidx.browser.customtabs.CustomTabsIntent;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.Task;
Expand All @@ -36,7 +36,7 @@
import com.google.firebase.appdistribution.FirebaseAppDistributionException.Status;
import com.google.firebase.inject.Provider;
import com.google.firebase.installations.FirebaseInstallationsApi;
import java.util.List;
import java.util.Collections;
import java.util.concurrent.Executor;
import javax.inject.Inject;
import javax.inject.Singleton;
Expand Down Expand Up @@ -212,10 +212,7 @@ private void openSignInFlowInBrowser(String fid, Activity activity) {
}

private boolean supportsCustomTabs(Context context) {
Intent customTabIntent = new Intent("android.support.customtabs.action.CustomTabsService");
customTabIntent.setPackage("com.android.chrome");
List<ResolveInfo> resolveInfos =
context.getPackageManager().queryIntentServices(customTabIntent, 0);
return resolveInfos != null && !resolveInfos.isEmpty();
String packageName = CustomTabsClient.getPackageName(context, Collections.emptyList());
return packageName != null;
}
}
Loading