Question

My App Account is deleted when power is lost to the device (if the power cable is removed, no battery), other Accounts (example, Dropbox, Google, LinkedIn) remain intact.

I have used Accounts many times before, and have not had this issue. My work involves coding for a specific device that is not mainstream. An Android set-top TV box. The firmware is based from Android 4.1.

I have a typical pattern for an Account.

Creating using an AccountAuthenticatorActivity. Authenticated with AbstractAccountAuthenticator. I have a couple of AbstractThreadedSyncAdapters.

My main question(s), is what different ways can an account be deleted. Can these ways be stopped by overriding getAccountRemovalAllowed (I put code in to log this function, it never gets called when it is removed through power-off)? How can I stop my Account being deleted on power-off?

I realise this may be more a problem with the firmware on the device, being non-standard. However, if it were a problem with the firmware, I would expect none of the Apps Accounts to persist.

Was it helpful?

Solution

It seems like this particular problem is caused by the firmware.

The App prefers installation on the SD Card. The SD Card was loaded late in the boot process and so the Account for the App was not loaded.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top