Francesco Mameli
Francesco Mameli

Reputation: 125

Android M (preview) App Standby

I'm trying to put an app in standby mode. I'm using an emulator running Android API 23 (Revision 1). I am not able to put the app in standby by following the steps listed in the official docs:

When I test if the app is actually in standby using adb shell am get-inactive <packageName> I always obtain the following result "Idle=false". I've also locked the screen before executing the commands listed above but the result is always the same "Idle=false". Is anyone else experiencing the same behavior?

Upvotes: 2

Views: 1008

Answers (2)

Flyview
Flyview

Reputation: 1959

I was running into the same thing. It turns out if the package has a widget currently on the launcher screen, it gets prevented from going into standby mode, even with the adb command. Remove the widget and toggling inactive mode should work. You can also set an app into app standby by going to developer settings, scroll all the way to the bottom and click on "inactive apps" and then you can toggle it there (may have to long hold the app).

EDIT: You also need to have the device unplugged or pretend unplug it with: adb shell dumpsys battery unplug

Upvotes: 1

greywolf82
greywolf82

Reputation: 22183

There is a bug in the emulator and you can't set an app in idle mode using adb commands. You need to use a real device.

Upvotes: 1

Related Questions