Prevent installation of new APEX.

This was previously only done on user build and the code convergence
caused bugs that we haven't spotted for a while.

Change-Id: Ib7f51b5ef6d3f221483eb2e2dcb2f4d19a0fbbee
Fixes: 132429173
Test: APEX CTS tests on both user and userdebug builds
This commit is contained in:
Dario Freni
2019-05-10 17:52:21 +01:00
committed by Todd Kennedy
parent f953da0c20
commit 3322473183

View File

@@ -36,7 +36,6 @@ import android.content.pm.PackageParser.SigningDetails.SignatureSchemeVersion;
import android.content.pm.ParceledListSlice;
import android.content.pm.Signature;
import android.content.rollback.IRollbackManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
@@ -116,12 +115,9 @@ public class StagingManager {
final PackageInfo packageInfo = mApexManager.getPackageInfoForApexName(packageName);
if (packageInfo == null) {
// Only allow installing new apexes if on a debuggable build.
if (!Build.IS_DEBUGGABLE) {
Slog.w(TAG, "Attempted to install new apex " + packageName + " on user build");
return false;
}
return true;
// Don't allow installation of new APEX.
Slog.e(TAG, "Attempted to install a new apex " + packageName + ". Rejecting");
return false;
}
final SigningDetails existingSigningDetails;