Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 388d4eee authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-security-14.0.0_r20' into staging/lineage-21.0_android-security-14.0.0_r20

Android Security 14.0.0 Release 20 (13218413)

* tag 'android-security-14.0.0_r20':
  [vims] better handle assistant force stop
  RESTRICT AUTOMERGE Clear the BAL allowlist duration
  Add equals method
  Remove invalid null check for callingPackage
  Allow core uids to register receiver as "android".
  RESTRICT AUTOMERGE Normalize home intent
  Delay appop revocation when only capability is lost
  Impose a threshold on the number of attributed op entries returned in a binder call
  Add a list of Biometric protected packages
  Avoid app pinning requests if the Task is already locked
  Don't allow non-system uids to use "android" as calling package.

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	packages/PackageInstaller/src/com/android/packageinstaller/InstallStart.java
	services/core/java/com/android/server/appop/AppOpsService.java
	services/core/java/com/android/server/wm/ActivityStartInterceptor.java
	services/core/java/com/android/server/wm/ActivityStarter.java

Change-Id: I622309a0ef09382ac56bb6d4e11cfd53173f9b78
parents 91bf90e2 de4ebd5d
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -23,12 +23,13 @@ import android.os.IBinder;
import com.android.internal.util.Preconditions;

import java.util.List;
import java.util.Objects;

/**
 * Privileges granted to a Process that allows it to execute starts from the background.
 * @hide
 */
public class BackgroundStartPrivileges {
public final class BackgroundStartPrivileges {
    /** No privileges. */
    public static final BackgroundStartPrivileges NONE = new BackgroundStartPrivileges(
            false, false, null);
@@ -190,4 +191,22 @@ public class BackgroundStartPrivileges {
                + ", originatingToken=" + mOriginatingToken
                + ']';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BackgroundStartPrivileges that = (BackgroundStartPrivileges) o;
        return mAllowsBackgroundActivityStarts == that.mAllowsBackgroundActivityStarts
                && mAllowsBackgroundForegroundServiceStarts
                == that.mAllowsBackgroundForegroundServiceStarts
                && Objects.equals(mOriginatingToken, that.mOriginatingToken);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mAllowsBackgroundActivityStarts,
                mAllowsBackgroundForegroundServiceStarts,
                mOriginatingToken);
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -6986,4 +6986,8 @@

    <!-- The key containing the branching boolean for legacy Search. -->
    <string name="config_defaultContextualSearchLegacyEnabled" translatable="false" />

    <!-- List of protected packages that require biometric authentication for modification
         (Disable, force-stop or uninstalling updates). -->
    <string-array name="config_biometric_protected_package_names" translatable="false" />
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -5375,4 +5375,8 @@
  <java-symbol type="string" name="config_defaultContextualSearchKey" />
  <java-symbol type="string" name="config_defaultContextualSearchEnabled" />
  <java-symbol type="string" name="config_defaultContextualSearchLegacyEnabled" />

  <!-- List of protected packages that require biometric authentication for modification -->
  <java-symbol type="array" name="config_biometric_protected_package_names" />

</resources>
+11 −0
Original line number Diff line number Diff line
@@ -119,4 +119,15 @@ public class BackgroundStartPrivilegesTest {
                Arrays.asList(BSP_ALLOW_A, BSP_ALLOW_A, BSP_ALLOW_A, BSP_ALLOW_A)))
                .isEqualTo(BSP_ALLOW_A);
    }

    @Test
    public void backgroundStartPrivilege_equals_works() {
        assertThat(NONE).isEqualTo(NONE);
        assertThat(ALLOW_BAL).isEqualTo(ALLOW_BAL);
        assertThat(ALLOW_FGS).isEqualTo(ALLOW_FGS);
        assertThat(BSP_ALLOW_A).isEqualTo(BSP_ALLOW_A);
        assertThat(NONE).isNotEqualTo(ALLOW_BAL);
        assertThat(ALLOW_FGS).isNotEqualTo(ALLOW_BAL);
        assertThat(BSP_ALLOW_A).isNotEqualTo(BSP_ALLOW_B);
    }
}
+7 −7
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.net.Uri;
@@ -94,11 +95,11 @@ public class InstallStart extends Activity {
        // If the activity was started via a PackageInstaller session, we retrieve the calling
        // package from that session
        final int sessionId = (isSessionInstall
                ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, -1)
                : -1);
                ? intent.getIntExtra(PackageInstaller.EXTRA_SESSION_ID, SessionInfo.INVALID_ID)
                : SessionInfo.INVALID_ID);
        int originatingUidFromSession = callingUid;
        if (callingPackage == null && sessionId != -1) {
            PackageInstaller packageInstaller = getPackageManager().getPackageInstaller();
        if (sessionId != SessionInfo.INVALID_ID) {
            PackageInstaller packageInstaller = mPackageManager.getPackageInstaller();
            PackageInstaller.SessionInfo sessionInfo = packageInstaller.getSessionInfo(sessionId);
            if (sessionInfo != null) {
                callingPackage = sessionInfo.getInstallerPackageName();
@@ -257,7 +258,7 @@ public class InstallStart extends Activity {
    private ApplicationInfo getSourceInfo(@Nullable String callingPackage) {
        if (callingPackage != null) {
            try {
                return getPackageManager().getApplicationInfo(callingPackage, 0);
                return mPackageManager.getApplicationInfo(callingPackage, 0);
            } catch (PackageManager.NameNotFoundException ex) {
                // ignore
            }
@@ -265,7 +266,6 @@ public class InstallStart extends Activity {
        return null;
    }


    @NonNull
    private boolean canPackageQuery(int callingUid, Uri packageUri) {
        ProviderInfo info = mPackageManager.resolveContentProvider(packageUri.getAuthority(),
@@ -295,7 +295,7 @@ public class InstallStart extends Activity {
        if (originatingUid == Process.ROOT_UID) {
            return true;
        }
        PackageInstaller packageInstaller = getPackageManager().getPackageInstaller();
        PackageInstaller packageInstaller = mPackageManager.getPackageInstaller();
        PackageInstaller.SessionInfo sessionInfo = packageInstaller.getSessionInfo(sessionId);
        if (sessionInfo == null) {
            return false;
Loading