| Index: web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
|
| diff --git a/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java b/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
|
| index 8812c36c39853dbab4958862763fc32a551b279f..a1badbd04a5aa934ee7b6c8f1212886e3aa6eaed 100644
|
| --- a/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
|
| +++ b/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
|
| @@ -10,6 +10,8 @@ import android.content.Intent;
|
| import android.os.IBinder;
|
| import android.util.Log;
|
|
|
| +import org.chromium.minting.lib.common.WebAPKUtils;
|
| +
|
| import java.io.File;
|
| import java.lang.reflect.Constructor;
|
|
|
| @@ -31,10 +33,7 @@ public class MintingServiceFactory extends Service {
|
| // TODO(pkotwicz): Add dex to application's ClassLoader. Only load dex the first time that
|
| // {@link MintingServiceFactory#onBind()} is called.
|
|
|
| - String remotePackageName = getSharedPreferences(MintingApplication.MINT_PREFS, MODE_PRIVATE)
|
| - .getString(MintingApplication.HOST_PACKAGE_PREF,
|
| - MintingApplication.DEFAULT_CHROME_PACKAGE_NAME);
|
| - Context remoteContext = DexLoader.getRemoteContext(this, remotePackageName);
|
| + Context remoteContext = WebAPKUtils.getHostBrowserContext(this);
|
| if (remoteContext == null) {
|
| Log.w(TAG, "Failed to get remote context.");
|
| }
|
| @@ -50,9 +49,10 @@ public class MintingServiceFactory extends Service {
|
| }
|
|
|
| try {
|
| +
|
| Class<?> mintedServiceImplClass =
|
| webApkClassLoader.loadClass(MINTED_SERVICE_IMPL_CLASS_NAME);
|
| - Constructor mintedServiceImplConstructor =
|
| + Constructor<?> mintedServiceImplConstructor =
|
| mintedServiceImplClass.getConstructor(Context.class);
|
| return (IBinder) mintedServiceImplConstructor.newInstance(new Object[] {this});
|
| } catch (Exception e) {
|
|
|