OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
Sam McNally
2017/01/25 05:53:06
2017
blundell
2017/01/25 15:00:34
Done.
| |
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 InterfaceRegistry createInterfaceRegistryForContext( | |
Sam McNally
2017/01/25 05:53:06
Return void.
blundell
2017/01/25 15:00:34
Done.
| |
20 int nativeHandle, Context applicationContext) { | |
21 InterfaceRegistry registry = InterfaceRegistry.create( | |
22 CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessa gePipeHandle()); | |
23 registry.addInterface( | |
24 BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicationCon text)); | |
blundell
2017/01/24 11:35:43
I originally thought I would generalize this code
| |
25 return registry; | |
26 } | |
27 } | |
OLD | NEW |