trs80
(James Andrewartha)
Septembre 2, 2021, 3:55
15
J’ai fait quelques recherches à ce sujet et j’ai trouvé les éléments suivants :
https://git.tt-rss.org/fox/tt-rss-android/src/branch/master/org.fox.ttrss/src/main/java/org/fox/ttrss/CommonActivity.java#L97
Voici également une implémentation qui utilise correctement les onglets personnalisés de Firefox sur mon appareil :
static final String LOCAL_PACKAGE = "com.google.android.apps.chrome";
private static final String EXTRA_CUSTOM_TABS_KEEP_ALIVE =
"android.support.customtabs.extra.KEEP_ALIVE";
private static final String ACTION_CUSTOM_TABS_CONNECTION =
"android.support.customtabs.action.CustomTabsService";
private static String sPackageNameToUse;
private CustomTabsHelper() {}
/**
* Goes through all apps that handle VIEW intents and have a warmup service. Picks
* the one chosen by the user if there is one, otherwise makes a best effort to return a
* valid package name.
*
* This is <strong>not</strong> threadsafe.
*
* @param context {@link Context} to use for accessing {@link PackageManager}.
* @return The package name recommended to use for connecting to custom tabs related components.
*/
public static String getPackageNameToUse(Context context) {
Pourriez-vous donc le réajouter avec cette détection supplémentaire, ce qui supprimerait correctement la dépendance à Chrome et rendrait l’application à nouveau utile ?