File tree Expand file tree Collapse file tree
library/src/main/java/com/okta/oidc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,16 +180,13 @@ protected void onNewIntent(Intent intent) {
180180 @ VisibleForTesting
181181 protected String getBrowser () {
182182 PackageManager pm = getPackageManager ();
183- Intent browserIntent = new Intent (Intent .ACTION_VIEW , Uri .parse ("https://www.example.com" ));
184- List <ResolveInfo > resolveInfoList = pm .queryIntentActivities (browserIntent , mMatchFlag );
183+ Intent serviceIntent = new Intent ();
184+ serviceIntent .setAction (CustomTabsService .ACTION_CUSTOM_TABS_CONNECTION );
185+ List <ResolveInfo > resolveInfoList = pm .queryIntentServices (serviceIntent , mMatchFlag );
185186 List <String > customTabsBrowsers = new ArrayList <>();
187+
186188 for (ResolveInfo info : resolveInfoList ) {
187- Intent serviceIntent = new Intent ();
188- serviceIntent .setAction (CustomTabsService .ACTION_CUSTOM_TABS_CONNECTION );
189- serviceIntent .setPackage (info .activityInfo .packageName );
190- if (pm .resolveService (serviceIntent , 0 ) != null ) {
191- customTabsBrowsers .add (info .activityInfo .packageName );
192- }
189+ customTabsBrowsers .add (info .serviceInfo .packageName );
193190 }
194191 for (String browser : mSupportedBrowsers ) {
195192 if (customTabsBrowsers .contains (browser )) {
You can’t perform that action at this time.
0 commit comments