Skip to content

Commit 2b58c1b

Browse files
rich canningsAndroid (Google) Code Review
authored andcommitted
Merge "Disable package verification in test harness" into jb-mr1-dev
2 parents 2032a12 + a2064df commit 2b58c1b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

services/java/com/android/server/pm/PackageManagerService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.xmlpull.v1.XmlPullParserException;
4646
import org.xmlpull.v1.XmlSerializer;
4747

48+
import android.app.ActivityManager;
4849
import android.app.ActivityManagerNative;
4950
import android.app.IActivityManager;
5051
import android.app.admin.IDevicePolicyManager;
@@ -5890,6 +5891,10 @@ private boolean isVerificationEnabled(int flags) {
58905891

58915892
// Check if installing from ADB
58925893
if ((flags & PackageManager.INSTALL_FROM_ADB) != 0) {
5894+
// Do not run verification in a test harness environment
5895+
if (ActivityManager.isRunningInTestHarness()) {
5896+
return false;
5897+
}
58935898
// Check if the developer does not want package verification for ADB installs
58945899
if (android.provider.Settings.Global.getInt(mContext.getContentResolver(),
58955900
android.provider.Settings.Global.PACKAGE_VERIFIER_INCLUDE_ADB, 1) == 0) {

0 commit comments

Comments
 (0)