| Index: web_apks/minting_example/src/org/chromium/minting/WebApkServiceFactory.java
|
| diff --git a/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java b/web_apks/minting_example/src/org/chromium/minting/WebApkServiceFactory.java
|
| similarity index 91%
|
| rename from web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
|
| rename to web_apks/minting_example/src/org/chromium/minting/WebApkServiceFactory.java
|
| index a2053c07d3ee05593f497ff357db107ad590205a..e338a7b3d3c790963922a6d67fc3e844b878ec59 100644
|
| --- a/web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
|
| +++ b/web_apks/minting_example/src/org/chromium/minting/WebApkServiceFactory.java
|
| @@ -14,7 +14,7 @@ import android.os.Bundle;
|
| import android.os.IBinder;
|
| import android.util.Log;
|
|
|
| -import org.chromium.minting.lib.common.WebAPKUtils;
|
| +import org.chromium.minting.lib.common.WebApkUtils;
|
|
|
| import java.io.File;
|
| import java.lang.reflect.Constructor;
|
| @@ -24,14 +24,14 @@ import java.util.Scanner;
|
| * Shell class for services provided by Web APK to Chrome. Extracts code with implementation of
|
| * services from .dex file in Chrome APK.
|
| */
|
| -public class MintingServiceFactory extends Service {
|
| - private static final String TAG = "cr.MintingServiceFactory";
|
| +public class WebApkServiceFactory extends Service {
|
| + private static final String TAG = "cr.WebApkServiceFactory";
|
|
|
| /**
|
| * Name of the class with IBinder API implementation.
|
| */
|
| private static final String MINTED_SERVICE_IMPL_CLASS_NAME =
|
| - "org.chromium.minting.libs.runtime_library.MintedServiceImpl";
|
| + "org.chromium.minting.libs.runtime_library.WebApkServiceImpl";
|
|
|
| private static final String KEY_APP_ICON_ID = "app_icon_id";
|
| private static final String KEY_EXPECTED_HOST_BROWSER = "expected_host_browser";
|
| @@ -55,7 +55,7 @@ public class MintingServiceFactory extends Service {
|
|
|
| /*
|
| * ClassLoader for loading {@link MINTED_SERVICE_IMPL_CLASS_NAME}. Static so that all
|
| - * {@link MintingServiceFactory} service instatiations use the same ClassLoader during the app's
|
| + * {@link WebApkServiceFactory} service instatiations use the same ClassLoader during the app's
|
| * lifetime.
|
| */
|
| private static ClassLoader sClassLoader;
|
| @@ -75,13 +75,13 @@ public class MintingServiceFactory extends Service {
|
| sClassLoader.loadClass(MINTED_SERVICE_IMPL_CLASS_NAME);
|
| Constructor<?> mintedServiceImplConstructor =
|
| mintedServiceImplClass.getConstructor(Context.class, Bundle.class);
|
| - String expectedHostPackageName = WebAPKUtils.getHostBrowserPackageName(this);
|
| + String expectedHostPackageName = WebApkUtils.getHostBrowserPackageName(this);
|
| Bundle bundle = new Bundle();
|
| bundle.putInt(KEY_APP_ICON_ID, R.drawable.app_icon);
|
| bundle.putString(KEY_EXPECTED_HOST_BROWSER, expectedHostPackageName);
|
| return (IBinder) mintedServiceImplConstructor.newInstance(new Object[] {this, bundle});
|
| } catch (Exception e) {
|
| - Log.w(TAG, "Unable to create MintedServiceImpl.");
|
| + Log.w(TAG, "Unable to create WebApkServiceImpl.");
|
| e.printStackTrace();
|
| return null;
|
| }
|
| @@ -93,7 +93,7 @@ public class MintingServiceFactory extends Service {
|
| * @return The ClassLoader.
|
| */
|
| private static ClassLoader createClassLoader(Context context) {
|
| - Context remoteContext = WebAPKUtils.getHostBrowserContext(context);
|
| + Context remoteContext = WebApkUtils.getHostBrowserContext(context);
|
| if (remoteContext == null) {
|
| Log.w(TAG, "Failed to get remote context.");
|
| return null;
|
| @@ -112,7 +112,7 @@ public class MintingServiceFactory extends Service {
|
| DexLoader.deleteCachedDexes(localDexDir);
|
| }
|
|
|
| - String dexAssetName = WebAPKUtils.getRuntimeDexName(newRuntimeDexVersion);
|
| + String dexAssetName = WebApkUtils.getRuntimeDexName(newRuntimeDexVersion);
|
| File remoteDexFile =
|
| new File(remoteContext.getDir("dex", Context.MODE_PRIVATE), dexAssetName);
|
| return DexLoader.load(remoteContext, dexAssetName, MINTED_SERVICE_IMPL_CLASS_NAME,
|
|
|