[ARC++] Install apk's with -g

This resolves issues with tests that need extra permissions to be
granted on the APK's to succeed. Since it should not affect existing
tests, I made it the default behavior for all tests, but it can be
disabled with an argument.

BUG=b:78476884
TEST=test_that cheets_MailBench # passes on Eve

Change-Id: I3fe02839bf42aa294ac73943c6a0ac37a22700c4
Reviewed-on: https://chromium-review.googlesource.com/1038051
Commit-Ready: Luis Hector Chavez <lhchavez@chromium.org>
Tested-by: Lloyd Pique <lpique@chromium.org>
Reviewed-by: Luis Hector Chavez <lhchavez@chromium.org>
diff --git a/client/common_lib/cros/arc.py b/client/common_lib/cros/arc.py
index afe37df..f65fdd1 100644
--- a/client/common_lib/cros/arc.py
+++ b/client/common_lib/cros/arc.py
@@ -188,12 +188,15 @@
     return output
 
 
-def adb_install(apk):
+def adb_install(apk, auto_grant_permissions=True):
     """Install an apk into container. You must connect first.
 
     @param apk: Package to install.
+    @param auto_grant_permissions: Set to false to not automatically grant all
+    permissions. Most tests should not care.
     """
-    return adb_cmd('install -r %s' % apk, timeout=60*5)
+    flags = '-g' if auto_grant_permissions else ''
+    return adb_cmd('install -r %s %s' % (flags, apk), timeout=60*5)
 
 
 def adb_uninstall(apk):