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

Issue 641703002: Rewrite the Android implementation of BatteryMonitor directly in Java. (Closed)

Created:
6 years, 2 months ago by ppi
Modified:
6 years ago
CC:
chromium-reviews, creis+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, nasko+codewatch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, darin (slow to review), ben+mojo_chromium.org, mkwst+moarreviews-shell_chromium.org, jochen+watch_chromium.org, blundell
Base URL:
https://chromium.googlesource.com/chromium/src.git@battery-status-api-to-mojo
Project:
chromium
Visibility:
Public.

Description

Rewrite the Android implementation of BatteryMonitor directly in Java. This patch introduces a standalone Android implementation of the BatteryMonitor service. New implementation is written in Java without any JNI code, and is made available in the render process host using the Java ServiceRegistry. BUG=420623 Committed: https://crrev.com/1dfc74724f2acfefbb4d783c65511d6a3f74cd9f Cr-Commit-Position: refs/heads/master@{#309029}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Rebase. #

Patch Set 3 : Rebase. #

Patch Set 4 : Address Ben's comments, update GN build, polish. #

Total comments: 7

Patch Set 5 : git cl format #

Patch Set 6 : Address Ben's comments. #

Total comments: 2

Patch Set 7 : Address Ben's comments. #

Patch Set 8 : Rebase. #

Patch Set 9 : Fix DEPS. #

Total comments: 2

Patch Set 10 : Rebase. #

Patch Set 11 : Fix Android browsertests. #

Patch Set 12 : Rebase. #

Patch Set 13 : Address Tim's comment. #

Patch Set 14 : Try to fix the webview build. #

Patch Set 15 : webview build: explicitly declare Java outputs on the battery status bindings target. #

Patch Set 16 : webview, build! #

Total comments: 2

Patch Set 17 : Address Torne's comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+387 lines, -354 lines) Patch
M android_webview/java_library_common.mk View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +6 lines, -0 lines 0 comments Download
M android_webview/libwebviewchromium.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +5 lines, -3 lines 0 comments Download
M content/app/android/library_loader_hooks.cc View 1 2 2 chunks +0 lines, -4 lines 0 comments Download
M content/browser/android/browser_jni_registrar.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/mojo/mojo_application_host.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
A content/browser/mojo/service_registrar_android.h View 1 2 3 4 1 chunk +24 lines, -0 lines 0 comments Download
A content/browser/mojo/service_registrar_android.cc View 1 2 3 4 1 chunk +26 lines, -0 lines 0 comments Download
M content/browser/mojo/service_registry_android.h View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_jni.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/android/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M content/public/android/DEPS View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M content/shell/browser/shell_mojo_test_utils_android.cc View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M device/battery/BUILD.gn View 1 2 3 2 chunks +0 lines, -11 lines 0 comments Download
M device/battery/android/BUILD.gn View 1 2 3 1 chunk +11 lines, -3 lines 0 comments Download
D device/battery/android/battery_jni_registrar.h View 1 chunk +0 lines, -20 lines 0 comments Download
D device/battery/android/battery_jni_registrar.cc View 1 chunk +0 lines, -27 lines 0 comments Download
A device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +71 lines, -0 lines 0 comments Download
A device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorImpl.java View 1 2 3 4 1 chunk +58 lines, -0 lines 0 comments Download
M device/battery/android/java/src/org/chromium/device/battery/BatteryStatusManager.java View 1 2 3 4 5 6 4 chunks +50 lines, -64 lines 0 comments Download
M device/battery/android/javatests/src/org/chromium/device/battery/BatteryStatusManagerTest.java View 1 2 3 4 5 6 7 chunks +44 lines, -82 lines 0 comments Download
M device/battery/battery.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +31 lines, -23 lines 0 comments Download
D device/battery/battery_status_manager_android.h View 1 1 chunk +0 lines, -45 lines 0 comments Download
D device/battery/battery_status_manager_android.cc View 1 chunk +0 lines, -65 lines 0 comments Download

Messages

Total messages: 43 (22 generated)
ppi
Status as of patch set 1: - it works :) (in the browser with http://jsbin.com/battery-status-test) ...
6 years, 2 months ago (2014-10-08 14:58:45 UTC) #2
qsr
About the tests, you should register the specific implementation as a mojo service, which will ...
6 years, 2 months ago (2014-10-08 16:01:29 UTC) #3
ppi
This should be ready for a second pass, ptal. https://codereview.chromium.org/641703002/diff/1/device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorImpl.java File device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorImpl.java (right): https://codereview.chromium.org/641703002/diff/1/device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorImpl.java#newcode42 device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorImpl.java:42: ...
6 years ago (2014-12-12 14:55:29 UTC) #4
qsr
https://codereview.chromium.org/641703002/diff/60001/content/browser/mojo/mojo_application_host.h File content/browser/mojo/mojo_application_host.h (right): https://codereview.chromium.org/641703002/diff/60001/content/browser/mojo/mojo_application_host.h#newcode48 content/browser/mojo/mojo_application_host.h:48: #endif Keep a space before private: https://codereview.chromium.org/641703002/diff/60001/content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java File content/public/android/java/src/org/chromium/content/browser/ServiceRegistrar.java ...
6 years ago (2014-12-12 15:31:57 UTC) #5
ppi
Thanks, ptal. https://codereview.chromium.org/641703002/diff/60001/content/browser/mojo/mojo_application_host.h File content/browser/mojo/mojo_application_host.h (right): https://codereview.chromium.org/641703002/diff/60001/content/browser/mojo/mojo_application_host.h#newcode48 content/browser/mojo/mojo_application_host.h:48: #endif On 2014/12/12 15:31:57, qsr wrote: > ...
6 years ago (2014-12-12 16:02:16 UTC) #6
qsr
LGTM with nits. https://codereview.chromium.org/641703002/diff/60001/device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java File device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java (right): https://codereview.chromium.org/641703002/diff/60001/device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java#newcode22 device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java:22: public class BatteryMonitorFactory { On 2014/12/12 ...
6 years ago (2014-12-12 16:49:08 UTC) #7
ppi
Thanks! https://codereview.chromium.org/641703002/diff/100001/device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java File device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java (right): https://codereview.chromium.org/641703002/diff/100001/device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java#newcode34 device/battery/android/java/src/org/chromium/device/battery/BatteryMonitorFactory.java:34: boolean charging, double chargingTime, double dischargingTime, double level) ...
6 years ago (2014-12-12 17:10:41 UTC) #8
ppi
+ Tim, Jam Tim, could you review the device/battery part? Jam, could you review the ...
6 years ago (2014-12-12 17:17:01 UTC) #10
timvolodine
this is great :). just one question below. https://codereview.chromium.org/641703002/diff/160001/device/battery/battery_status_manager_android.cc File device/battery/battery_status_manager_android.cc (left): https://codereview.chromium.org/641703002/diff/160001/device/battery/battery_status_manager_android.cc#oldcode49 device/battery/battery_status_manager_android.cc:49: UMA_HISTOGRAM_BOOLEAN("BatteryStatus.StartAndroid", ...
6 years ago (2014-12-15 12:47:21 UTC) #11
ppi
https://codereview.chromium.org/641703002/diff/160001/device/battery/battery_status_manager_android.cc File device/battery/battery_status_manager_android.cc (left): https://codereview.chromium.org/641703002/diff/160001/device/battery/battery_status_manager_android.cc#oldcode49 device/battery/battery_status_manager_android.cc:49: UMA_HISTOGRAM_BOOLEAN("BatteryStatus.StartAndroid", result); On 2014/12/15 12:47:21, timvolodine wrote: > any ...
6 years ago (2014-12-15 13:52:38 UTC) #12
timvolodine
On 2014/12/15 13:52:38, ppi wrote: > https://codereview.chromium.org/641703002/diff/160001/device/battery/battery_status_manager_android.cc > File device/battery/battery_status_manager_android.cc (left): > > https://codereview.chromium.org/641703002/diff/160001/device/battery/battery_status_manager_android.cc#oldcode49 > ...
6 years ago (2014-12-15 18:04:36 UTC) #13
jam
lgtm
6 years ago (2014-12-15 19:22:31 UTC) #14
timvolodine
On 2014/12/15 19:22:31, jam wrote: > lgtm lgtm device/battery, if you are landing this without ...
6 years ago (2014-12-17 13:27:17 UTC) #20
ppi
Thanks, Tim! I'm adding the Java API for UMA in https://codereview.chromium.org/794273004/ . When it lands, ...
6 years ago (2014-12-17 19:02:50 UTC) #25
ppi
+Marcin for the webview build changes Marcin, could you review: - android_webview/java_library_common.mk - android_webview/libwebviewchromium.gypi - ...
6 years ago (2014-12-18 15:51:13 UTC) #35
mkosiba (inactive)
this looks good to me but deferring to torne@ for final judgement
6 years ago (2014-12-18 16:12:09 UTC) #37
Torne
One suggestion, but then LGTM https://codereview.chromium.org/641703002/diff/630001/device/battery/battery.gyp File device/battery/battery.gyp (right): https://codereview.chromium.org/641703002/diff/630001/device/battery/battery.gyp#newcode46 device/battery/battery.gyp:46: 'action': ['python', '--version'], Not ...
6 years ago (2014-12-18 16:20:47 UTC) #38
ppi
Thanks, Marcin and Torne! https://codereview.chromium.org/641703002/diff/630001/device/battery/battery.gyp File device/battery/battery.gyp (right): https://codereview.chromium.org/641703002/diff/630001/device/battery/battery.gyp#newcode46 device/battery/battery.gyp:46: 'action': ['python', '--version'], On 2014/12/18 ...
6 years ago (2014-12-18 16:54:15 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/641703002/650001
6 years ago (2014-12-18 16:55:28 UTC) #41
commit-bot: I haz the power
Committed patchset #17 (id:650001)
6 years ago (2014-12-18 17:43:22 UTC) #42
commit-bot: I haz the power
6 years ago (2014-12-18 18:05:53 UTC) #43
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/1dfc74724f2acfefbb4d783c65511d6a3f74cd9f
Cr-Commit-Position: refs/heads/master@{#309029}

Powered by Google App Engine
This is Rietveld 408576698