boolean isAuthorized ( String accountId ) { try { DataStore < StoredCredential > sc = StoredCredential . getDefaultDataStore ( dataStoreFactory ) ; return sc . containsKey ( accountId ) ; } catch ( IOException e ) { return false ; } }
Checks if the given account id has already been authorized and the user granted access to his calendars info .