We are working on an tablet app where users are given option to sign in their Google accounts and use these to access files stored on Google Drive. The tablets are locked in kiosk mode and multiple users are sharing the same tablet, therefore I need to find a way to provide users the option to remove their credentials once they are done.
The accounts are added/selected using GoogleSignInClient (https://developers.google.com/identity/sign-in/android/sign-in).
So far, I tried the following:
AccountManager.removeAccount()
cannot be used, as <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
handles only local accounts
<uses-permission android:name="android.permission.ACCOUNT_MANAGER"/>
is reserved for system apps
Accounts section in Android settings can't be accessed since the app is in kiosk mode.
Is there any other way how to remove a Google account from within the app?
Eventually we resolved this using an intent to System account settings.
Intent myIntent = new Intent(Settings.ACTION_SYNC_SETTINGS);
startActivityForResult(myIntent, REQUEST_CODE_ACCOUNT_SETTINGS);