Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: chrome/android/webapk/libs/common/src/org/chromium/webapk/lib/common/WebApkHelper.java

Issue 2974573002: Refactor WebApkServiceConnectionManager. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698