mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make DeviceInfoModule extend code-generated Java spec
Summary: I think this NativeModule was converted before we checked in the Java codegen output for TurboModules. I'm making `DeviceInfoModule` extend `NativeDeviceInfoSpec` to properly make it a TurboModule. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D19911145 fbshipit-source-id: fcec8c5b991bd9fd991e690dfa51f1bd36117e5f
This commit is contained in:
committed by
Facebook Github Bot
parent
c0d8c1db90
commit
8bb78553a2
+4
-3
@@ -9,6 +9,7 @@ package com.facebook.react.modules.deviceinfo;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.fbreact.specs.NativeDeviceInfoSpec;
|
||||
import com.facebook.react.bridge.LifecycleEventListener;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
||||
@@ -25,8 +26,8 @@ import java.util.Map;
|
||||
|
||||
/** Module that exposes Android Constants to JS. */
|
||||
@ReactModule(name = DeviceInfoModule.NAME)
|
||||
public class DeviceInfoModule extends ReactContextBaseJavaModule
|
||||
implements LifecycleEventListener, TurboModule {
|
||||
public class DeviceInfoModule extends NativeDeviceInfoSpec
|
||||
implements LifecycleEventListener {
|
||||
|
||||
public static final String NAME = "DeviceInfo";
|
||||
|
||||
@@ -55,7 +56,7 @@ public class DeviceInfoModule extends ReactContextBaseJavaModule
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Map<String, Object> getConstants() {
|
||||
public @Nullable Map<String, Object> getTypedExportedConstants() {
|
||||
HashMap<String, Object> constants = new HashMap<>();
|
||||
constants.put("Dimensions", DisplayMetricsHolder.getDisplayMetricsMap(mFontScale));
|
||||
return constants;
|
||||
|
||||
Reference in New Issue
Block a user