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

Commit b6b014cd authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6645851 from a4b2b6a6 to rvc-qpr1-release

Change-Id: I85f1e78bbbdfc3366226573f05c1c40bb2b9e456
parents 05e00902 a4b2b6a6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
# If there are files in that filegroup that are not covered below, the classes in the
# module will be overwritten by the ones in the framework.
rule com.android.internal.util.** com.android.networkstack.tethering.util.@1
rule android.net.LocalLog* com.android.networkstack.tethering.LocalLog@1
rule android.util.LocalLog* com.android.networkstack.tethering.util.LocalLog@1

rule android.net.shared.Inet4AddressUtils* com.android.networkstack.tethering.shared.Inet4AddressUtils@1

+1 −1
Original line number Diff line number Diff line
@@ -8,4 +8,4 @@ rule com.android.internal.util.State* com.android.networkstack.tethering.util.St
rule com.android.internal.util.StateMachine* com.android.networkstack.tethering.util.StateMachine@1
rule com.android.internal.util.TrafficStatsConstants* com.android.networkstack.tethering.util.TrafficStatsConstants@1

rule android.net.LocalLog* com.android.networkstack.tethering.LocalLog@1
rule android.util.LocalLog* com.android.networkstack.tethering.util.LocalLog@1
+4 −3
Original line number Diff line number Diff line
@@ -1597,7 +1597,8 @@ public class AppOpsService extends IAppOpsService.Stub {
        packageUpdateFilter.addAction(Intent.ACTION_PACKAGE_REPLACED);
        packageUpdateFilter.addDataScheme("package");

        mContext.registerReceiver(mOnPackageUpdatedReceiver, packageUpdateFilter);
        mContext.registerReceiverAsUser(mOnPackageUpdatedReceiver, UserHandle.ALL,
                packageUpdateFilter, null, null);

        synchronized (this) {
            for (int uidNum = mUidStates.size() - 1; uidNum >= 0; uidNum--) {
@@ -1640,7 +1641,7 @@ public class AppOpsService extends IAppOpsService.Stub {
        final IntentFilter packageSuspendFilter = new IntentFilter();
        packageSuspendFilter.addAction(Intent.ACTION_PACKAGES_UNSUSPENDED);
        packageSuspendFilter.addAction(Intent.ACTION_PACKAGES_SUSPENDED);
        mContext.registerReceiver(new BroadcastReceiver() {
        mContext.registerReceiverAsUser(new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                final int[] changedUids = intent.getIntArrayExtra(Intent.EXTRA_CHANGED_UID_LIST);
@@ -1664,7 +1665,7 @@ public class AppOpsService extends IAppOpsService.Stub {
                    }
                }
            }
        }, packageSuspendFilter);
        }, UserHandle.ALL, packageSuspendFilter, null, null);

        final IntentFilter packageAddedFilter = new IntentFilter();
        packageAddedFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
+16 −10
Original line number Diff line number Diff line
@@ -11083,6 +11083,21 @@ public class PackageManagerService extends IPackageManager.Stub
            pkgSetting.forceQueryableOverride = true;
        }
        // If this is part of a standard install, set the initiating package name, else rely on
        // previous device state.
        if (reconciledPkg.installArgs != null) {
            InstallSource installSource = reconciledPkg.installArgs.installSource;
            if (installSource.initiatingPackageName != null) {
                final PackageSetting ips = mSettings.mPackages.get(
                        installSource.initiatingPackageName);
                if (ips != null) {
                    installSource = installSource.setInitiatingPackageSignatures(
                            ips.signatures);
                }
            }
            pkgSetting.setInstallSource(installSource);
        }
        // TODO(toddke): Consider a method specifically for modifying the Package object
        // post scan; or, moving this stuff out of the Package object since it has nothing
        // to do with the package on disk.
@@ -16089,16 +16104,7 @@ public class PackageManagerService extends IPackageManager.Stub
                    ps.setEnabled(COMPONENT_ENABLED_STATE_DEFAULT, userId, installerPackageName);
                }
                if (installSource.initiatingPackageName != null) {
                    final PackageSetting ips = mSettings.mPackages.get(
                            installSource.initiatingPackageName);
                    if (ips != null) {
                        installSource = installSource.setInitiatingPackageSignatures(
                                ips.signatures);
                    }
                }
                ps.setInstallSource(installSource);
                mSettings.addInstallerPackageNames(installSource);
                mSettings.addInstallerPackageNames(ps.installSource);
                // When replacing an existing package, preserve the original install reason for all
                // users that had the package installed before. Similarly for uninstall reasons.
+44 −15
Original line number Diff line number Diff line
@@ -19,10 +19,13 @@ package com.android.server.wm;
import static android.os.Process.myPid;
import static android.os.Process.myUid;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.WindowManager.INPUT_CONSUMER_NAVIGATION;
import static android.view.WindowManager.INPUT_CONSUMER_PIP;
import static android.view.WindowManager.INPUT_CONSUMER_RECENTS_ANIMATION;
import static android.view.WindowManager.INPUT_CONSUMER_WALLPAPER;
import static android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
import static android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
import static android.view.WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_DISABLE_WALLPAPER_TOUCH_EVENTS;
@@ -477,8 +480,7 @@ final class InputMonitor {
                    mService.getRecentsAnimationController();
            final boolean shouldApplyRecentsInputConsumer = recentsAnimationController != null
                    && recentsAnimationController.shouldApplyInputConsumer(w.mActivityRecord);
            if (inputChannel == null || inputWindowHandle == null || w.mRemoved
                    || (w.cantReceiveTouchInput() && !shouldApplyRecentsInputConsumer)) {
            if (inputWindowHandle == null || w.mRemoved) {
                if (w.mWinAnimator.hasSurface()) {
                    mInputTransaction.setInputWindowInfo(
                            w.mWinAnimator.mSurfaceController.getClientViewRootSurface(),
@@ -491,9 +493,23 @@ final class InputMonitor {
            final int flags = w.mAttrs.flags;
            final int privateFlags = w.mAttrs.privateFlags;
            final int type = w.mAttrs.type;
            final boolean hasFocus = w.isFocused();
            final boolean isVisible = w.isVisibleLw();

            // Assign an InputInfo with type to the overlay window which can't receive input event.
            // This is used to omit Surfaces from occlusion detection.
            if (inputChannel == null
                    || (w.cantReceiveTouchInput() && !shouldApplyRecentsInputConsumer))  {
                if (!w.mWinAnimator.hasSurface()) {
                    return;
                }
                populateOverlayInputInfo(inputWindowHandle, w.getName(), type, isVisible);
                mInputTransaction.setInputWindowInfo(
                        w.mWinAnimator.mSurfaceController.getClientViewRootSurface(),
                        inputWindowHandle);
                return;
            }

            final boolean hasFocus = w.isFocused();
            if (mAddRecentsAnimationInputConsumerHandle && shouldApplyRecentsInputConsumer) {
                if (recentsAnimationController.updateInputConsumerForApp(
                        mRecentsAnimationInputConsumer.mWindowHandle, hasFocus)) {
@@ -555,6 +571,28 @@ final class InputMonitor {
        }
    }

    // This would reset InputWindowHandle fields to prevent it could be found by input event.
    // We need to check if any new field of InputWindowHandle could impact the result.
    private static void populateOverlayInputInfo(final InputWindowHandle inputWindowHandle,
            final String name, final int type, final boolean isVisible) {
        inputWindowHandle.name = name;
        inputWindowHandle.layoutParamsType = type;
        inputWindowHandle.dispatchingTimeoutNanos =
                WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS;
        inputWindowHandle.visible = isVisible;
        inputWindowHandle.canReceiveKeys = false;
        inputWindowHandle.hasFocus = false;
        inputWindowHandle.ownerPid = myPid();
        inputWindowHandle.ownerUid = myUid();
        inputWindowHandle.inputFeatures = INPUT_FEATURE_NO_INPUT_CHANNEL;
        inputWindowHandle.scaleFactor = 1;
        inputWindowHandle.layoutParamsFlags =
                FLAG_NOT_TOUCH_MODAL | FLAG_NOT_TOUCHABLE | FLAG_NOT_FOCUSABLE;
        inputWindowHandle.portalToDisplayId = INVALID_DISPLAY;
        inputWindowHandle.touchableRegion.setEmpty();
        inputWindowHandle.setTouchableRegionCrop(null);
    }

    /**
     * Helper function to generate an InputInfo with type SECURE_SYSTEM_OVERLAY. This input
     * info will not have an input channel or be touchable, but is used to omit Surfaces
@@ -564,16 +602,7 @@ final class InputMonitor {
    static void setTrustedOverlayInputInfo(SurfaceControl sc, SurfaceControl.Transaction t,
            int displayId, String name) {
        InputWindowHandle inputWindowHandle = new InputWindowHandle(null, displayId);
        inputWindowHandle.name = name;
        inputWindowHandle.layoutParamsType = TYPE_SECURE_SYSTEM_OVERLAY;
        inputWindowHandle.dispatchingTimeoutNanos = -1;
        inputWindowHandle.visible = true;
        inputWindowHandle.canReceiveKeys = false;
        inputWindowHandle.hasFocus = false;
        inputWindowHandle.ownerPid = myPid();
        inputWindowHandle.ownerUid = myUid();
        inputWindowHandle.inputFeatures = INPUT_FEATURE_NO_INPUT_CHANNEL;
        inputWindowHandle.scaleFactor = 1;
        populateOverlayInputInfo(inputWindowHandle, name, TYPE_SECURE_SYSTEM_OVERLAY, true);
        t.setInputWindowInfo(sc, inputWindowHandle);
    }
}