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

Side by Side Diff: services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java

Issue 2643713002: Port BatteryMonitor into Device Service (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.device_service;
6
7 import android.content.Context;
8
9 import org.chromium.base.annotations.CalledByNative;
10 import org.chromium.base.annotations.JNINamespace;
11 import org.chromium.device.BatteryMonitor;
12 import org.chromium.device.battery.BatteryMonitorFactory;
13 import org.chromium.mojo.system.impl.CoreImpl;
14 import org.chromium.services.service_manager.InterfaceRegistry;
15
16 @JNINamespace("device")
17 class InterfaceRegistrar {
18 @CalledByNative
19 static void createInterfaceRegistryForContext(int nativeHandle, Context appl icationContext) {
20 // Note: The bindings code manages the lifetime of this object, so it
21 // is not necessary to hold on to a reference to it explicitly.
22 InterfaceRegistry registry = InterfaceRegistry.create(
23 CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessa gePipeHandle());
24 registry.addInterface(
25 BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicationCon text));
26 }
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698