Monday, December 22, 2014

Android 5 (Lollipop) broke some Hibernate functionality

As you may know I have a side project for Android called Hibernate which is mentioned here on the blog site among other useful links, and has its own dedicated page with a short description. So I think it's not too much offtopic here if I post a piece of news about Hibernate. Unfortunately this is bad news.

Android 5.0.1 Lollipop broke some of Hibernate's functionality. Google made some changes in the new OS that made it impossible to monitor foreground task via ActivityManager. Most importantly, it was done intentionally and based on some paranoid security considerations (see below), so no workaround is left for non-rooted devices. I must say this is not the first time when Google changes their OS in very questionnable manner and actually degrades user experience.

Here is what the official documentation says about getRunningTasks method of ActivityManager:

This method is no longer available to third party applications: the introduction of document-centric recents means it can leak person information to the caller. For backwards compatibility, it will still return a small subset of its data: at least the caller's own tasks, and possibly some other tasks such as home that are known to not be sensitive.

As a result, the option Rehibernation in the Hibernate app has no effect anymore. But I'm trying to elaborate a workaround anyway.

As a side-effect, the system log is flooded with messages:

getTasks: caller XXXXX does not hold GET_TASKS; limiting output

but this does not impair usability.

No comments:

Post a Comment