Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.webapk.lib.common; | 5 package org.chromium.webapk.lib.common; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.pm.ApplicationInfo; | 8 import android.content.pm.ApplicationInfo; |
| 9 import android.content.pm.PackageManager; | 9 import android.content.pm.PackageManager; |
| 10 import android.content.pm.PackageManager.NameNotFoundException; | 10 import android.content.pm.PackageManager.NameNotFoundException; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 context.getPackageName(), PackageManager.GET_META_DATA); | 51 context.getPackageName(), PackageManager.GET_META_DATA); |
| 52 Bundle bundle = ai.metaData; | 52 Bundle bundle = ai.metaData; |
| 53 hostPackage = bundle.getString("runtimeHost"); | 53 hostPackage = bundle.getString("runtimeHost"); |
| 54 } catch (NameNotFoundException e) { | 54 } catch (NameNotFoundException e) { |
| 55 e.printStackTrace(); | 55 e.printStackTrace(); |
| 56 } | 56 } |
| 57 // Set {@link sHostPackage} to a non-null value so that the value is com puted only once. | 57 // Set {@link sHostPackage} to a non-null value so that the value is com puted only once. |
| 58 sHostPackage = hostPackage != null ? hostPackage : ""; | 58 sHostPackage = hostPackage != null ? hostPackage : ""; |
| 59 return sHostPackage; | 59 return sHostPackage; |
| 60 } | 60 } |
| 61 | |
| 62 /** | |
| 63 * Returns name of "Runtime Dex" asset in Chrome APK based on version. | |
| 64 * @param version | |
| 65 * @return Dex asset name. | |
| 66 */ | |
| 67 public static String getRuntimeDexName(int version) { | |
| 68 return "web_apk" + version + ".dex"; | |
|
Xi Han
2016/05/26 21:40:23
I think we need to change it to "webapk".
| |
| 69 } | |
| 61 } | 70 } |
| OLD | NEW |