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

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

Issue 2897313002: Android: Simplify isTablet and InterfaceRegistrars (Closed)
Patch Set: Pull out local variable Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
diff --git a/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java b/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
index c2f3731fd59c2f9df51a94bd664838c797eca014..7f447d8d958a16b6c145790ab5cb65275e195d8b 100644
--- a/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
+++ b/services/device/android/java/src/org/chromium/services/device/InterfaceRegistrar.java
@@ -4,9 +4,6 @@
package org.chromium.services.device;
-import android.content.Context;
-
-import org.chromium.base.ContextUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.device.battery.BatteryMonitorFactory;
@@ -26,15 +23,10 @@ class InterfaceRegistrar {
int nativeHandle, NfcDelegate nfcDelegate) {
// Note: The bindings code manages the lifetime of this object, so it
// is not necessary to hold on to a reference to it explicitly.
- // TODO(wnwen): Move calls to ContextUtils down to the individual factories.
- Context applicationContext = ContextUtils.getApplicationContext();
InterfaceRegistry registry = InterfaceRegistry.create(
CoreImpl.getInstance().acquireNativeHandle(nativeHandle).toMessagePipeHandle());
- registry.addInterface(
- BatteryMonitor.MANAGER, new BatteryMonitorFactory(applicationContext));
- registry.addInterface(
- NfcProvider.MANAGER, new NfcProviderImpl.Factory(applicationContext, nfcDelegate));
- registry.addInterface(
- VibrationManager.MANAGER, new VibrationManagerImpl.Factory(applicationContext));
+ registry.addInterface(BatteryMonitor.MANAGER, new BatteryMonitorFactory());
+ registry.addInterface(NfcProvider.MANAGER, new NfcProviderImpl.Factory(nfcDelegate));
+ registry.addInterface(VibrationManager.MANAGER, new VibrationManagerImpl.Factory());
}
}

Powered by Google App Engine
This is Rietveld 408576698