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

Unverified Commit 77fd8552 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

tconfig-lineage; aospremote; lineageremote; repo start...

tconfig-lineage; aospremote; lineageremote; repo start staging/lineage-18.1_merge_android-security-11.0.0_r68
git fetch --tag aosp android-security-11.0.0_r68 && git merge
--log=200000 FETCH_HEAD
Merge tag 'android-security-11.0.0_r68' of https://android.googlesource.com/platform/frameworks/base into staging/lineage-18.1_merge_android-security-11.0.0_r68

Android Security 11.0.0 Release 68 (9892680)

* tag 'android-security-11.0.0_r68' of https://android.googlesource.com/platform/frameworks/base:
  [RESTRICT AUTOMERGE] Add BubbleMetadata detection to block FSI
  Enforce DevicePolicyManager.setUserControlDisabledPackages in AppStandbyController
  Allow filtering of services
  Handle invalid data during job loading.
  Check key intent for selectors and prohibited flags
  [DO NOT MERGE] Prevent RemoteViews crashing SystemUi
  [DO NOT MERGE] Wait for preloading images to complete before inflating notifications
  Prevent sharesheet from previewing unowned URIs
  Remove Activity if it enters PiP without window

Change-Id: Ic4a7393644dacfb146f704fc2fb18faee453c53b
parents d45e66b3 e8eea65c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -146,6 +146,8 @@ public interface AppStandbyInternal {

    void setActiveAdminApps(Set<String> adminPkgs, int userId);

    void setAdminProtectedPackages(Set<String> packageNames, int userId);

    void onAdminDataAvailable();

    void clearCarrierPrivilegedApps();
+23 −3
Original line number Diff line number Diff line
@@ -687,6 +687,10 @@ public final class JobStore {
                }
            } catch (XmlPullParserException | IOException e) {
                Slog.wtf(TAG, "Error jobstore xml.", e);
            } catch (Exception e) {
                // Crashing at this point would result in a boot loop, so live with a general
                // Exception for system stability's sake.
                Slog.wtf(TAG, "Unexpected exception", e);
            } finally {
                if (mPersistInfo.countAllJobsLoaded < 0) { // Only set them once.
                    mPersistInfo.countAllJobsLoaded = numJobs;
@@ -817,6 +821,15 @@ public final class JobStore {
            } catch (NumberFormatException e) {
                Slog.d(TAG, "Error reading constraints, skipping.");
                return null;
            } catch (XmlPullParserException e) {
                Slog.d(TAG, "Error Parser Exception.", e);
                return null;
            } catch (IOException e) {
                Slog.d(TAG, "Error I/O Exception.", e);
                return null;
            } catch (IllegalArgumentException e) {
                Slog.e(TAG, "Constraints contained invalid data", e);
                return null;
            }
            parser.next(); // Consume </constraints>

@@ -912,8 +925,14 @@ public final class JobStore {
                return null;
            }

            PersistableBundle extras = PersistableBundle.restoreFromXml(parser);
            final PersistableBundle extras;
            try {
                extras = PersistableBundle.restoreFromXml(parser);
                jobBuilder.setExtras(extras);
            } catch (IllegalArgumentException e) {
                Slog.e(TAG, "Persisted extras contained invalid data", e);
                return null;
            }
            parser.nextTag(); // Consume </extras>

            final JobInfo builtJob;
@@ -959,7 +978,8 @@ public final class JobStore {
            return new JobInfo.Builder(jobId, cname);
        }

        private void buildConstraintsFromXml(JobInfo.Builder jobBuilder, XmlPullParser parser) {
        private void buildConstraintsFromXml(JobInfo.Builder jobBuilder, XmlPullParser parser)
                throws XmlPullParserException, IOException {
            String val;

            final String netCapabilities = parser.getAttributeValue(null, "net-capabilities");
+40 −0
Original line number Diff line number Diff line
@@ -233,6 +233,10 @@ public class AppStandbyController implements AppStandbyInternal {
    @GuardedBy("mActiveAdminApps")
    private final SparseArray<Set<String>> mActiveAdminApps = new SparseArray<>();

    /** List of admin protected packages. Can contain {@link android.os.UserHandle#USER_ALL}. */
    @GuardedBy("mAdminProtectedPackages")
    private final SparseArray<Set<String>> mAdminProtectedPackages = new SparseArray<>();

    /**
     * Set of system apps that are headless (don't have any declared activities, enabled or
     * disabled). Presence in this map indicates that the app is a headless system app.
@@ -1019,6 +1023,9 @@ public class AppStandbyController implements AppStandbyInternal {
            synchronized (mActiveAdminApps) {
                mActiveAdminApps.remove(userId);
            }
            synchronized (mAdminProtectedPackages) {
                mAdminProtectedPackages.remove(userId);
            }
        }
    }

@@ -1108,6 +1115,10 @@ public class AppStandbyController implements AppStandbyInternal {
                return STANDBY_BUCKET_EXEMPTED;
            }

            if (isAdminProtectedPackages(packageName, userId)) {
                return STANDBY_BUCKET_EXEMPTED;
            }

            if (isActiveNetworkScorer(packageName)) {
                return STANDBY_BUCKET_EXEMPTED;
            }
@@ -1510,6 +1521,17 @@ public class AppStandbyController implements AppStandbyInternal {
        }
    }

    private boolean isAdminProtectedPackages(String packageName, int userId) {
        synchronized (mAdminProtectedPackages) {
            if (mAdminProtectedPackages.contains(UserHandle.USER_ALL)
                    && mAdminProtectedPackages.get(UserHandle.USER_ALL).contains(packageName)) {
                return true;
            }
            return mAdminProtectedPackages.contains(userId)
                    && mAdminProtectedPackages.get(userId).contains(packageName);
        }
    }

    @Override
    public void addActiveDeviceAdmin(String adminPkg, int userId) {
        synchronized (mActiveAdminApps) {
@@ -1533,6 +1555,17 @@ public class AppStandbyController implements AppStandbyInternal {
        }
    }

    @Override
    public void setAdminProtectedPackages(Set<String> packageNames, int userId) {
        synchronized (mAdminProtectedPackages) {
            if (packageNames == null || packageNames.isEmpty()) {
                mAdminProtectedPackages.remove(userId);
            } else {
                mAdminProtectedPackages.put(userId, packageNames);
            }
        }
    }

    @Override
    public void onAdminDataAvailable() {
        mAdminDataAvailableLatch.countDown();
@@ -1555,6 +1588,13 @@ public class AppStandbyController implements AppStandbyInternal {
        }
    }

    @VisibleForTesting
    Set<String> getAdminProtectedPackagesForTest(int userId) {
        synchronized (mAdminProtectedPackages) {
            return mAdminProtectedPackages.get(userId);
        }
    }

    /**
     * Returns {@code true} if the supplied package is the device provisioning app. Otherwise,
     * returns {@code false}.
+2 −1
Original line number Diff line number Diff line
@@ -11996,7 +11996,8 @@ public class DevicePolicyManager {
    /**
     * Called by Device owner to disable user control over apps. User will not be able to clear
     * app data or force-stop packages.
     * app data or force-stop packages. Packages with user control disabled are exempted from
     * App Standby Buckets.
     *
     * @param admin which {@link DeviceAdminReceiver} this request is associated with
     * @param packages The package names for the apps.
+29 −10
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.pm.LauncherActivityInfo;
import android.content.pm.LauncherApps;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
import android.os.Bundle;
@@ -250,6 +251,14 @@ public class AppWidgetHostView extends FrameLayout {
            super.onLayout(changed, left, top, right, bottom);
        } catch (final RuntimeException e) {
            Log.e(TAG, "Remote provider threw runtime exception, using error view instead.", e);
            handleViewError();
        }
    }

    /**
     * Remove bad view and replace with error message view
     */
    private void handleViewError() {
        removeViewInLayout(mView);
        View child = getErrorView();
        prepareView(child);
@@ -261,7 +270,6 @@ public class AppWidgetHostView extends FrameLayout {
        mView = child;
        mViewMode = VIEW_MODE_ERROR;
    }
    }

    /**
     * Provide guidance about the size of this widget to the AppWidgetManager. The widths and
@@ -725,4 +733,15 @@ public class AppWidgetHostView extends FrameLayout {
            }
        };
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        try {
            super.dispatchDraw(canvas);
        } catch (Exception e) {
            // Catch draw exceptions that may be caused by RemoteViews
            Log.e(TAG, "Drawing view failed: " + e);
            post(this::handleViewError);
        }
    }
}
Loading