prevent runtime restart loop in charging test

now that it's possible to get battery level without runtime,
it's possible to enter charging test with framework in a bad
state.

to make charging more effective, we try to detect if runtime is
up; in case it's not, we do a 'adb shell stop' to prevent from
'charging' device while it's in a runtime restart loop.

Change-Id: Ie3c62ef6c6850ecac5ab077a7f100799ed5cc3c5
1 file changed