use of com.microsoft.identity.common.internal.broker.ipc.AccountManagerAddAccountStrategy in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrokerMsalController method getIpcStrategies.
/**
* Gets a list of communication strategies.
* Order of objects in the list will reflects the order of strategies that will be used.
*/
@NonNull
private static List<IIpcStrategy> getIpcStrategies(final Context applicationContext, final String activeBrokerPackageName) {
final List<IIpcStrategy> strategies = new ArrayList<>();
final StringBuilder sb = new StringBuilder(100);
sb.append("Broker Strategies added : ");
final ContentProviderStrategy contentProviderStrategy = new ContentProviderStrategy(applicationContext);
if (contentProviderStrategy.isBrokerContentProviderAvailable(activeBrokerPackageName)) {
sb.append("ContentProviderStrategy, ");
strategies.add(contentProviderStrategy);
}
final MicrosoftAuthClient client = new MicrosoftAuthClient(applicationContext);
if (client.isBoundServiceSupported(activeBrokerPackageName)) {
sb.append("BoundServiceStrategy, ");
strategies.add(new BoundServiceStrategy<>(client));
}
if (AccountManagerUtil.canUseAccountManagerOperation(applicationContext)) {
sb.append("AccountManagerStrategy.");
strategies.add(new AccountManagerAddAccountStrategy(applicationContext));
}
Logger.info(TAG, sb.toString());
return strategies;
}
Aggregations