Update Bridge due to an update of the init method signature
Bug: 117921091
Test: N/A
Change-Id: I1a5e562e7191ae9484437ce1a9bc95ddc31c9d54
(cherry picked from commit c1bed7d91dab5758847cebd63ce6a51aa8b26151)
diff --git a/bridge/src/com/android/layoutlib/bridge/Bridge.java b/bridge/src/com/android/layoutlib/bridge/Bridge.java
index 9d46148..1012a8f 100644
--- a/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -174,6 +174,7 @@
@Override
public boolean init(Map<String,String> platformProperties,
File fontLocation,
+ String nativeLibPath,
String icuDataPath,
Map<String, Map<String, Integer>> enumValueMap,
LayoutLog log) {
diff --git a/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java b/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java
index 36c09ad..a148cdc 100644
--- a/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java
+++ b/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java
@@ -312,7 +312,7 @@
File buildProp = new File(PLATFORM_DIR, "build.prop");
File attrs = new File(res, "values" + File.separator + "attrs.xml");
sBridge = new Bridge();
- sBridge.init(ConfigGenerator.loadProperties(buildProp), fontLocation, null,
+ sBridge.init(ConfigGenerator.loadProperties(buildProp), fontLocation, null, null,
ConfigGenerator.getEnumMap(attrs), getLayoutLog());
Bridge.getLock().lock();
try {
diff --git a/remote/client/src/com/android/layoutlib/bridge/remote/client/RemoteBridgeClient.java b/remote/client/src/com/android/layoutlib/bridge/remote/client/RemoteBridgeClient.java
index a5248c8..6c738c9 100644
--- a/remote/client/src/com/android/layoutlib/bridge/remote/client/RemoteBridgeClient.java
+++ b/remote/client/src/com/android/layoutlib/bridge/remote/client/RemoteBridgeClient.java
@@ -85,12 +85,13 @@
@Override
public boolean init(Map<String, String> platformProperties,
File fontLocation,
+ String nativeLibPath,
String icuDataPath,
Map<String, Map<String, Integer>> enumValueMap,
LayoutLog log) {
try {
- return mDelegate.init(platformProperties, fontLocation, icuDataPath, enumValueMap,
- RemoteLayoutLogAdapter.create(log));
+ return mDelegate.init(platformProperties, fontLocation, nativeLibPath, icuDataPath,
+ enumValueMap, RemoteLayoutLogAdapter.create(log));
} catch (RemoteException e) {
throw new RuntimeException(e);
}
diff --git a/remote/common/src/com/android/layout/remote/api/RemoteBridge.java b/remote/common/src/com/android/layout/remote/api/RemoteBridge.java
index 790e47e..8186a2a 100644
--- a/remote/common/src/com/android/layout/remote/api/RemoteBridge.java
+++ b/remote/common/src/com/android/layout/remote/api/RemoteBridge.java
@@ -62,6 +62,7 @@
*
* @param platformProperties The build properties for the platform.
* @param fontLocation the location of the fonts.
+ * @param nativeLibPath the absolute path of the JNI library for layoutlib.
* @param icuDataPath the location of the ICU data used natively.
* @param enumValueMap map attrName ⇒ { map enumFlagName ⇒ Integer value }. This is typically
* read from attrs.xml in the SDK target.
@@ -70,7 +71,8 @@
* @return true if success.
*/
boolean init(@NotNull Map<String, String> platformProperties, File fontLocation,
- String icuDataPath, @NotNull Map<String, Map<String, Integer>> enumValueMap,
+ @Nullable String nativeLibPath, @Nullable String icuDataPath,
+ @NotNull Map<String, Map<String, Integer>> enumValueMap,
@Nullable RemoteLayoutLog log) throws RemoteException;
/**
diff --git a/remote/server/src/com/android/layoutlib/bridge/remote/server/RemoteBridgeImpl.java b/remote/server/src/com/android/layoutlib/bridge/remote/server/RemoteBridgeImpl.java
index a4c52b6..9de38ed 100644
--- a/remote/server/src/com/android/layoutlib/bridge/remote/server/RemoteBridgeImpl.java
+++ b/remote/server/src/com/android/layoutlib/bridge/remote/server/RemoteBridgeImpl.java
@@ -74,10 +74,11 @@
}
@Override
- public boolean init(Map<String, String> platformProperties, File fontLocation, String icuDataPath,
+ public boolean init(Map<String, String> platformProperties, File fontLocation,
+ String nativeLibPath, String icuDataPath,
Map<String, Map<String, Integer>> enumValueMap, RemoteLayoutLog log) {
- return mBridge.init(platformProperties, fontLocation, icuDataPath, enumValueMap,
- log != null ? new RemoteLayoutLogAdapter(log) : null);
+ return mBridge.init(platformProperties, fontLocation, nativeLibPath, icuDataPath,
+ enumValueMap, log != null ? new RemoteLayoutLogAdapter(log) : null);
}
@Override
diff --git a/remote/tests/src/RemoteBridgeTest.java b/remote/tests/src/RemoteBridgeTest.java
index 6ad10cb..5dd3b4f 100644
--- a/remote/tests/src/RemoteBridgeTest.java
+++ b/remote/tests/src/RemoteBridgeTest.java
@@ -75,7 +75,7 @@
File buildProp = new File(PLATFORM_DIR, "build.prop");
File attrs = new File(res, "values" + File.separator + "attrs.xml");
- mClient.init(ConfigGenerator.loadProperties(buildProp), fontLocation, null,
+ mClient.init(ConfigGenerator.loadProperties(buildProp), fontLocation, null, null,
ConfigGenerator.getEnumMap(attrs), getLayoutLog());
System.out.printf("Remote client init took %dms\n",
System.currentTimeMillis() - startTime);