Search in sources :

Example 1 with ISharedPreferencesFileManager

use of com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager in project microsoft-authentication-library-common-for-android by AzureAD.

the class EstsTelemetry method createLastRequestTelemetryCache.

private IRequestTelemetryCache createLastRequestTelemetryCache(@NonNull final Context context) {
    final String methodName = ":createLastRequestTelemetryCache";
    if (context == null) {
        Logger.verbose(TAG + methodName, "Context is NULL. Unable to create last request telemetry cache.");
        return null;
    }
    Logger.verbose(TAG + methodName, "Creating Last Request Telemetry Cache");
    final ISharedPreferencesFileManager sharedPreferencesFileManager = SharedPreferencesFileManager.getSharedPreferences(context, LAST_REQUEST_TELEMETRY_SHARED_PREFERENCES, -1, null);
    return new SharedPreferencesLastRequestTelemetryCache(sharedPreferencesFileManager);
}
Also used : ISharedPreferencesFileManager(com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager)

Example 2 with ISharedPreferencesFileManager

use of com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager in project microsoft-authentication-library-common-for-android by AzureAD.

the class BrokerOAuth2TokenCacheTest method initFociCache.

private void initFociCache(final Context context) {
    final ISharedPreferencesFileManager fociCacheFileManager = getFociFileManager(context);
    mFociCredentialCache = getAccountCredentialCache(fociCacheFileManager);
    mFociCache = getTokenCache(context, mFociCredentialCache, true);
}
Also used : ISharedPreferencesFileManager(com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager)

Example 3 with ISharedPreferencesFileManager

use of com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager in project microsoft-authentication-library-common-for-android by AzureAD.

the class BrokerOAuth2TokenCacheTest method initOtherCaches.

private void initOtherCaches(final Context context) {
    testAppUids = new int[] { 1338, 1339, 1340, 1341 };
    final List<ISharedPreferencesFileManager> fileManagers = getAppUidFileManagers(context, testAppUids);
    mOtherAppCredentialCaches = getAccountCredentialCaches(fileManagers);
    mOtherAppTokenCaches = new ArrayList<>();
    for (final IAccountCredentialCache cache : mOtherAppCredentialCaches) {
        mOtherAppTokenCaches.add(getTokenCache(context, cache, false));
    }
}
Also used : ISharedPreferencesFileManager(com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager) IAccountCredentialCache(com.microsoft.identity.common.internal.cache.IAccountCredentialCache)

Example 4 with ISharedPreferencesFileManager

use of com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager in project microsoft-authentication-library-common-for-android by AzureAD.

the class BrokerOAuth2TokenCacheTest method initAppUidCache.

private MsalOAuth2TokenCache initAppUidCache(final Context context, final int uid) {
    final ISharedPreferencesFileManager appUidCacheFileManager = getAppUidFileManager(context, uid);
    mAppUidCredentialCache = getAccountCredentialCache(appUidCacheFileManager);
    return getTokenCache(context, mAppUidCredentialCache, false);
}
Also used : ISharedPreferencesFileManager(com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager)

Aggregations

ISharedPreferencesFileManager (com.microsoft.identity.common.internal.cache.ISharedPreferencesFileManager)4 IAccountCredentialCache (com.microsoft.identity.common.internal.cache.IAccountCredentialCache)1