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

Unified Diff: build/android/devil/android/apk_helper.py

Issue 1338813003: GN: Side-load dex files as well as native code in incremental installs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix pylint warnings Created 5 years, 3 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: build/android/devil/android/apk_helper.py
diff --git a/build/android/devil/android/apk_helper.py b/build/android/devil/android/apk_helper.py
index 73d4b6b214b8b0f8be02f188497085539825a4df..27a7ed4140f12d40b6707c11da27f0364530cc83 100644
--- a/build/android/devil/android/apk_helper.py
+++ b/build/android/devil/android/apk_helper.py
@@ -13,7 +13,7 @@ from pylib import constants
_AAPT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt')
_MANIFEST_ATTRIBUTE_RE = re.compile(
- r'\s*A: ([^\(\)= ]*)\([^\(\)= ]*\)="(.*)" \(Raw: .*\)$')
+ r'\s*A: ([^\(\)= ]*)\([^\(\)= ]*\)=(?:"(.*)" \(Raw: .*\)|\(type.*?\)(.*))$')
_MANIFEST_ELEMENT_RE = re.compile(r'\s*(?:E|N): (\S*) .*$')
_PACKAGE_NAME_RE = re.compile(r'package: .*name=\'(\S*)\'')
_SPLIT_NAME_RE = re.compile(r'package: .*split=\'(\S*)\'')
@@ -60,7 +60,7 @@ def _ParseManifestFromApk(apk_path):
if m:
if not m.group(1) in node:
node[m.group(1)] = []
- node[m.group(1)].append(m.group(2))
+ node[m.group(1)].append(m.group(2) or m.group(3))
continue
return parsed_manifest
@@ -72,6 +72,7 @@ class ApkHelper(object):
self._manifest = None
self._package_name = None
self._split_name = None
+ self._has_isolated_processes = None
def GetActivityName(self):
"""Returns the name of the Activity in the apk."""
@@ -130,6 +131,18 @@ class ApkHelper(object):
return self._split_name
return None
+ def HasIsolatedProcesses(self):
+ """Returns whether any services exist that use isolatedProcess=true."""
+ if self._has_isolated_processes is None:
+ manifest_info = self._GetManifest()
+ try:
+ services = manifest_info['manifest']['application']['service']
+ self._has_isolated_processes = (
+ any(int(v, 0) for v in services['android:isolatedProcess']))
+ except KeyError:
+ self._has_isolated_processes = False
+ return self._has_isolated_processes
+
def _GetManifest(self):
if not self._manifest:
self._manifest = _ParseManifestFromApk(self._apk_path)

Powered by Google App Engine
This is Rietveld 408576698