Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Issue 993733002: Add new method to disable android device charging. (Closed)

Created:
5 years, 9 months ago by rnephew (Reviews Here)
Modified:
5 years, 9 months ago
CC:
chromium-reviews, klundberg+watch_chromium.org, yfriedman+watch_chromium.org, jbudorick+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add new method to disable android device charging. This method makes the device think that it is not charging. This is useful for getting battery data from dumpsys. BUG= Committed: https://crrev.com/b4490b70f969cab0598d75edc1572c5075c1453f Cr-Commit-Position: refs/heads/master@{#320991}

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Total comments: 4

Patch Set 4 : #

Total comments: 19

Patch Set 5 : #

Total comments: 10

Patch Set 6 : #

Total comments: 3

Patch Set 7 : #

Total comments: 4

Patch Set 8 : #

Total comments: 2

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -3 lines) Patch
M build/android/pylib/device/device_utils.py View 1 2 3 4 5 6 7 8 4 chunks +84 lines, -3 lines 0 comments Download
M build/android/pylib/device/device_utils_test.py View 1 2 3 4 5 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (7 generated)
rnephew (Wrong account)
5 years, 9 months ago (2015-03-09 21:00:50 UTC) #2
jbudorick
+perezju, since he's also written a lot in device_utils.py https://codereview.chromium.org/993733002/diff/1/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/1/build/android/pylib/device/device_utils.py#newcode1419 build/android/pylib/device/device_utils.py:1419: ...
5 years, 9 months ago (2015-03-09 21:49:55 UTC) #4
rnephew (Wrong account)
https://codereview.chromium.org/993733002/diff/1/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/1/build/android/pylib/device/device_utils.py#newcode1419 build/android/pylib/device/device_utils.py:1419: if line != _DUMPSYS_BATTERY_DISABLED: On 2015/03/09 21:49:55, jbudorick wrote: ...
5 years, 9 months ago (2015-03-09 23:58:09 UTC) #5
jbudorick
Basically: DeviceUtils is a very bad place to handle an unexpected condition silently. https://codereview.chromium.org/993733002/diff/1/build/android/pylib/device/device_utils.py File ...
5 years, 9 months ago (2015-03-10 00:04:43 UTC) #6
perezju
https://codereview.chromium.org/993733002/diff/20001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/20001/build/android/pylib/device/device_utils.py#newcode1425 build/android/pylib/device/device_utils.py:1425: result[k.strip()] = v.strip() I think you should just log ...
5 years, 9 months ago (2015-03-10 09:46:09 UTC) #7
jbudorick
https://codereview.chromium.org/993733002/diff/20001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/20001/build/android/pylib/device/device_utils.py#newcode1463 build/android/pylib/device/device_utils.py:1463: self._cache['charging_config'] = _DEFAULT_CHARGING_COMMANDS On 2015/03/10 09:46:09, perezju wrote: > ...
5 years, 9 months ago (2015-03-10 13:22:36 UTC) #8
rnephew (Wrong account)
On 2015/03/10 13:22:36, jbudorick wrote: > https://codereview.chromium.org/993733002/diff/20001/build/android/pylib/device/device_utils.py > File build/android/pylib/device/device_utils.py (right): > > https://codereview.chromium.org/993733002/diff/20001/build/android/pylib/device/device_utils.py#newcode1463 > ...
5 years, 9 months ago (2015-03-10 13:27:25 UTC) #9
rnephew (Wrong account)
https://codereview.chromium.org/993733002/diff/1/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/1/build/android/pylib/device/device_utils.py#newcode1419 build/android/pylib/device/device_utils.py:1419: if line != _DUMPSYS_BATTERY_DISABLED: On 2015/03/10 00:04:43, jbudorick wrote: ...
5 years, 9 months ago (2015-03-10 14:56:35 UTC) #10
perezju
On 2015/03/10 13:27:25, rnephew wrote: > This document can give more information on why we ...
5 years, 9 months ago (2015-03-11 10:40:56 UTC) #11
klundberg
On 2015/03/11 10:40:56, perezju wrote: > On 2015/03/10 13:27:25, rnephew wrote: > > This document ...
5 years, 9 months ago (2015-03-11 14:24:02 UTC) #12
klundberg
Noticed a few minor things when I looked at this today. https://codereview.chromium.org/993733002/diff/40001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): ...
5 years, 9 months ago (2015-03-11 14:27:14 UTC) #13
rnephew (Wrong account)
On 2015/03/11 14:24:02, klundberg wrote: > On 2015/03/11 10:40:56, perezju wrote: > > On 2015/03/10 ...
5 years, 9 months ago (2015-03-11 14:52:12 UTC) #14
perezju
On 2015/03/11 14:52:12, rnephew wrote: > On 2015/03/11 14:24:02, klundberg wrote: > > IMHO, we ...
5 years, 9 months ago (2015-03-11 15:39:07 UTC) #15
jbudorick
On 2015/03/11 14:52:12, rnephew wrote: > On 2015/03/11 14:24:02, klundberg wrote: > > On 2015/03/11 ...
5 years, 9 months ago (2015-03-11 15:44:14 UTC) #16
rnephew (Wrong account)
Made it into a context manager. https://codereview.chromium.org/993733002/diff/40001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/40001/build/android/pylib/device/device_utils.py#newcode1423 build/android/pylib/device/device_utils.py:1423: # If usb ...
5 years, 9 months ago (2015-03-11 18:27:01 UTC) #17
perezju
https://codereview.chromium.org/993733002/diff/60001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/60001/build/android/pylib/device/device_utils.py#newcode77 build/android/pylib/device/device_utils.py:77: } I think this is no longer used, so ...
5 years, 9 months ago (2015-03-12 09:37:14 UTC) #18
jbudorick
https://codereview.chromium.org/993733002/diff/60001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/60001/build/android/pylib/device/device_utils.py#newcode12 build/android/pylib/device/device_utils.py:12: from contextlib import contextmanager import contextlib, then use @contextlib.contextmanager ...
5 years, 9 months ago (2015-03-12 13:25:57 UTC) #19
perezju
https://codereview.chromium.org/993733002/diff/60001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/60001/build/android/pylib/device/device_utils.py#newcode1482 build/android/pylib/device/device_utils.py:1482: @decorators.WithTimeoutAndRetriesFromInstance() On 2015/03/12 13:25:57, jbudorick wrote: > On 2015/03/12 ...
5 years, 9 months ago (2015-03-12 13:43:26 UTC) #20
rnephew (Wrong account)
I also made the context manager throw an exception if it is on a device ...
5 years, 9 months ago (2015-03-12 18:17:59 UTC) #21
perezju
https://codereview.chromium.org/993733002/diff/80001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/80001/build/android/pylib/device/device_utils.py#newcode1494 build/android/pylib/device/device_utils.py:1494: def _DisableBatteryUpdates(self, timeout=None, retries=None): Thanks, this is looking a ...
5 years, 9 months ago (2015-03-13 10:19:07 UTC) #22
rnephew (Wrong account)
How would you guys feel about making the _Disable/EnableBatteryUpdates public, rather than private methods. We ...
5 years, 9 months ago (2015-03-16 16:33:40 UTC) #23
perezju
Thanks for the fixes. This lgtm with some nits. > How would you guys feel ...
5 years, 9 months ago (2015-03-17 12:52:20 UTC) #24
rnephew (Wrong account)
https://codereview.chromium.org/993733002/diff/100001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/100001/build/android/pylib/device/device_utils.py#newcode1513 build/android/pylib/device/device_utils.py:1513: # measurements are collected On 2015/03/17 12:52:19, perezju wrote: ...
5 years, 9 months ago (2015-03-17 19:58:42 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/993733002/120001
5 years, 9 months ago (2015-03-17 19:59:36 UTC) #28
jbudorick
I pulled you out of the CQ because of the index error. https://codereview.chromium.org/993733002/diff/120001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py ...
5 years, 9 months ago (2015-03-17 20:03:51 UTC) #30
rnephew (Wrong account)
https://codereview.chromium.org/993733002/diff/120001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/120001/build/android/pylib/device/device_utils.py#newcode1493 build/android/pylib/device/device_utils.py:1493: '--checkin'], check_return=True) On 2015/03/17 20:03:51, jbudorick wrote: > nit: ...
5 years, 9 months ago (2015-03-17 20:37:58 UTC) #31
jbudorick
https://codereview.chromium.org/993733002/diff/140001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/140001/build/android/pylib/device/device_utils.py#newcode1498 build/android/pylib/device/device_utils.py:1498: if (len(l) >= PWI_POWER_INDEX and l[ROW_TYPE_INDEX] == 'pwi' nit: ...
5 years, 9 months ago (2015-03-17 20:39:31 UTC) #32
jbudorick
On 2015/03/17 20:39:31, jbudorick wrote: that is, lgtm w/ nit > https://codereview.chromium.org/993733002/diff/140001/build/android/pylib/device/device_utils.py > File build/android/pylib/device/device_utils.py ...
5 years, 9 months ago (2015-03-17 20:39:46 UTC) #33
rnephew (Wrong account)
https://codereview.chromium.org/993733002/diff/140001/build/android/pylib/device/device_utils.py File build/android/pylib/device/device_utils.py (right): https://codereview.chromium.org/993733002/diff/140001/build/android/pylib/device/device_utils.py#newcode1498 build/android/pylib/device/device_utils.py:1498: if (len(l) >= PWI_POWER_INDEX and l[ROW_TYPE_INDEX] == 'pwi' On ...
5 years, 9 months ago (2015-03-17 20:43:08 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/993733002/160001
5 years, 9 months ago (2015-03-17 20:46:04 UTC) #37
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 9 months ago (2015-03-17 22:09:16 UTC) #38
commit-bot: I haz the power
5 years, 9 months ago (2015-03-17 22:10:01 UTC) #39
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/b4490b70f969cab0598d75edc1572c5075c1453f
Cr-Commit-Position: refs/heads/master@{#320991}

Powered by Google App Engine
This is Rietveld 408576698