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

Commit a90c8c3d authored by Abhishek Aggarwal's avatar Abhishek Aggarwal
Browse files

Merge remote-tracking branch 'origin/lineage-18.1' into v1-r

parents 56f35413 1b4001cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ public class ChooseTypeAndAccountActivity extends Activity
                mExistingAccounts = AccountManager.get(this).getAccountsForPackage(mCallingPackage,
                        mCallingUid);
                intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivityForResult(intent, REQUEST_ADD_ACCOUNT);
                startActivityForResult(new Intent(intent), REQUEST_ADD_ACCOUNT);
                return;
            }
        } catch (OperationCanceledException e) {
+18 −14
Original line number Diff line number Diff line
@@ -4288,20 +4288,24 @@ public class ActivityManagerService extends IActivityManager.Stub
                            finishForceStopPackageLocked(packageName, appInfo.uid);
                        }
                    }
                    if (succeeded) {
                        final Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED,
                            Uri.fromParts("package", packageName, null));
                                Uri.fromParts("package", packageName, null /* fragment */));
                        intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
                    intent.putExtra(Intent.EXTRA_UID, (appInfo != null) ? appInfo.uid : -1);
                        intent.putExtra(Intent.EXTRA_UID,
                                (appInfo != null) ? appInfo.uid : Process.INVALID_UID);
                        intent.putExtra(Intent.EXTRA_USER_HANDLE, resolvedUserId);
                        if (isInstantApp) {
                            intent.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName);
                        broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent,
                                null, null, 0, null, null, permission.ACCESS_INSTANT_APPS, null,
                                false, false, resolvedUserId, false);
                    } else {
                        broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent,
                                null, null, 0, null, null, null, null, false, false, resolvedUserId,
                                false);
                        }
                        broadcastIntentInPackage("android", null /* featureId */, SYSTEM_UID,
                                uid, pid, intent, null /* resolvedType */, null /* resultTo */,
                                0 /* resultCode */, null /* resultData */, null /* resultExtras */,
                                isInstantApp ? permission.ACCESS_INSTANT_APPS : null,
                                null /* bOptions */, false /* serialized */, false /* sticky */,
                                resolvedUserId, false /* allowBackgroundActivityStarts */);
                    }
                    if (observer != null) {
+16 −1
Original line number Diff line number Diff line
@@ -4523,7 +4523,16 @@ public class NotificationManagerService extends SystemService {
            }
            enforcePolicyAccess(Binder.getCallingUid(), "addAutomaticZenRule");

            return mZenModeHelper.addAutomaticZenRule(pkg, automaticZenRule,
            // If the calling app is the system (from any user), take the package name from the
            // rule's owner rather than from the caller's package.
            String rulePkg = pkg;
            if (isCallingAppIdSystem()) {
                if (automaticZenRule.getOwner() != null) {
                    rulePkg = automaticZenRule.getOwner().getPackageName();
                }
            }

            return mZenModeHelper.addAutomaticZenRule(rulePkg, automaticZenRule,
                    "addAutomaticZenRule");
        }

@@ -8731,6 +8740,12 @@ public class NotificationManagerService extends SystemService {
        return uid == Process.SYSTEM_UID;
    }

    protected boolean isCallingAppIdSystem() {
        final int uid = Binder.getCallingUid();
        final int appid = UserHandle.getAppId(uid);
        return appid == Process.SYSTEM_UID;
    }

    protected boolean isUidSystemOrPhone(int uid) {
        final int appid = UserHandle.getAppId(uid);
        return (appid == Process.SYSTEM_UID || appid == Process.PHONE_UID
+1 −6
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ public class ZenModeHelper {

    public String addAutomaticZenRule(String pkg, AutomaticZenRule automaticZenRule,
            String reason) {
        if (!isSystemRule(automaticZenRule)) {
        if (!ZenModeConfig.SYSTEM_AUTHORITY.equals(pkg)) {
            PackageItemInfo component = getServiceInfo(automaticZenRule.getOwner());
            if (component == null) {
                component = getActivityInfo(automaticZenRule.getConfigurationActivity());
@@ -554,11 +554,6 @@ public class ZenModeHelper {
        }
    }

    private boolean isSystemRule(AutomaticZenRule rule) {
        return rule.getOwner() != null
                && ZenModeConfig.SYSTEM_AUTHORITY.equals(rule.getOwner().getPackageName());
    }

    private ServiceInfo getServiceInfo(ComponentName owner) {
        Intent queryIntent = new Intent();
        queryIntent.setComponent(owner);
+13 −0
Original line number Diff line number Diff line
@@ -673,6 +673,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A

    private AppSaturationInfo mLastAppSaturationInfo;

    private final ActivityRecordInputSink mActivityRecordInputSink;

    // Activities with this uid are allowed to not create an input sink while being in the same
    // task and directly above this ActivityRecord. This field is updated whenever a new activity
    // is launched from this ActivityRecord. Touches are always allowed within the same uid.
    int mAllowedTouchUid;

    private final ColorDisplayService.ColorTransformController mColorTransformController =
            (matrix, translation) -> mWmService.mH.post(() -> {
                synchronized (mWmService.mGlobalLock) {
@@ -1650,6 +1657,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    ? (TaskDisplayArea) WindowContainer.fromBinder(daToken.asBinder()) : null;
            mHandoverLaunchDisplayId = options.getLaunchDisplayId();
        }

        mActivityRecordInputSink = new ActivityRecordInputSink(this, sourceRecord);
    }

    /**
@@ -3173,6 +3182,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    @Override
    void removeImmediately() {
        onRemovedFromDisplay();
        mActivityRecordInputSink.releaseSurfaceControl();
        super.removeImmediately();
    }

@@ -6048,6 +6058,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            } else if (!show && mLastSurfaceShowing) {
                getSyncTransaction().hide(mSurfaceControl);
            }
            if (show) {
                mActivityRecordInputSink.applyChangesToSurfaceIfChanged(getSyncTransaction());
            }
        }
        if (mThumbnail != null) {
            mThumbnail.setShowing(getPendingTransaction(), show);
Loading