2

Android Version: 7 Huawei devices

AccountManager still returns account information after the user has been logged off. It should not return account information after it has been logged off.

accountManager.getAccountsByType("com.huawei.hwid")

is there any alternative for getting active account info in Android?

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
Ashim Ghimire
  • 125
  • 1
  • 10

1 Answers1

1

Sign out is to cancel the authorization. Actually, you do not log out.

The getAccountsByType interface in the Account-AdvancedSDK can obtain account information without authorization.

The two are not in the same SDK. You can use the signIn interface in the SDK to obtain account information.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • actually, in the account section, there is no account present yet it returns an active account. Also, I am looking if there is an existing account or not. I just need the information but it is not for a login operation. is the sign interface the only solution. for this. – Ashim Ghimire Nov 09 '21 at 09:21
  • 1
    hi@Ashim Ghimire, Users and accounts do not refer to Huawei ID, but users on mobile phones. Huawei ID can only be registered on the HMS APK, and Huawei ID is not a user on a mobile phone. – zhangxaochen Nov 09 '21 at 09:49
  • hi, is it possible to check if there is an active Huawei ID signed in into the device for Huawei devices? – Ashim Ghimire Nov 09 '21 at 10:01
  • You cannot query whether a service is signed in. But you can call signIn to authorize the account and obtain the account information. – zhangxaochen Nov 10 '21 at 01:36