Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37d63069 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

add nullify annotations in IdentityProvider

parent 663dbe9c
Loading
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -44,15 +44,26 @@ public class IdentityProvider {
            null
    );

    @Nullable
    private final Uri mDiscoveryEndpoint;

    @Nullable
    private final Uri mAuthEndpoint;

    @Nullable
    private final Uri mTokenEndpoint;
    @NonNull
    private final String mClientId;

    @Nullable
    private final String mClientSecret;
    @NonNull
    private final Uri mRedirectUri;

    @Nullable
    private final String mScope;

    @Nullable
    private final String mUserInfoEndpoint;

    IdentityProvider(
+9 −6
Original line number Diff line number Diff line
@@ -53,11 +53,10 @@ open class CalendarsSyncAdapterService : SyncAdapterService() {
                   - sync conditions (e.g. "sync only in WiFi") are not met AND
                   - this is is an automatic sync (i.e. manual syncs are run regardless of sync conditions)
                 */
                if (!extras.containsKey(ContentResolver.SYNC_EXTRAS_MANUAL) && !checkSyncConditions(
                        accountSettings
                    )
                )
                if (!extras.containsKey(ContentResolver.SYNC_EXTRAS_MANUAL) &&
                    !checkSyncConditions(accountSettings)) {
                    return
                }

                if (accountSettings.getEventColors())
                    AndroidCalendar.insertColors(provider, account)
@@ -93,9 +92,13 @@ open class CalendarsSyncAdapterService : SyncAdapterService() {
                            if (authState.needsTokenRefresh) {
                                val tokenRequest = authState.createTokenRefreshRequest()
                                val clientSecretString = accountSettings.credentials().clientSecret
                                val clientSecret = OpenIdUtils.getClientAuthentication(clientSecretString)
                                val clientSecret =
                                    OpenIdUtils.getClientAuthentication(clientSecretString)

                                AuthorizationService(context).performTokenRequest(tokenRequest, clientSecret) { tokenResponse, ex ->
                                AuthorizationService(context).performTokenRequest(
                                    tokenRequest,
                                    clientSecret
                                ) { tokenResponse, ex ->
                                    authState.update(tokenResponse, ex)
                                    accountSettings.credentials(
                                        Credentials(