| Index: chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkHelper.java
|
| diff --git a/chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkHelper.java b/chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkHelper.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a75ccb41f96c8a64d90758b7636e655532786fc1
|
| --- /dev/null
|
| +++ b/chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkHelper.java
|
| @@ -0,0 +1,25 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.webapk.lib.common;
|
| +
|
| +import android.content.pm.ApplicationInfo;
|
| +import android.content.pm.PackageManager;
|
| +import android.os.Bundle;
|
| +
|
| +/**
|
| + * Contains utility methods that can be used by both Chrome and WebAPKs.
|
| + */
|
| +public class WebApkHelper {
|
| + /** Returns the <meta-data> in the Android Manifest of the given package name. */
|
| + public static Bundle readMetaData(PackageManager packageManager, String packageName) {
|
| + ApplicationInfo ai = null;
|
| + try {
|
| + ai = packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
|
| + } catch (PackageManager.NameNotFoundException e) {
|
| + return null;
|
| + }
|
| + return ai.metaData;
|
| + }
|
| +}
|
|
|