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

Commit 954f1f44 authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/cm-14.1' into v1-nougat

parents 70dcf0e9 0cd8f186
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -6639,7 +6639,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
    }
    private final boolean attachApplicationLocked(IApplicationThread thread,
    private boolean attachApplicationLocked(@NonNull IApplicationThread thread,
            int pid) {
        // Find the application record that is being attached...  either via
@@ -6887,6 +6887,9 @@ public final class ActivityManagerService extends ActivityManagerNative
    @Override
    public final void attachApplication(IApplicationThread thread) {
        if (thread == null) {
            throw new SecurityException("Invalid application interface");
        }
        synchronized (this) {
            int callingPid = Binder.getCallingPid();
            final long origId = Binder.clearCallingIdentity();
+4 −0
Original line number Diff line number Diff line
@@ -1531,6 +1531,10 @@ final class ActivityRecord {
        }
    }

    int getUid() {
        return info.applicationInfo.uid;
    }

    @Override
    public String toString() {
        if (stringName != null) {
+5 −0
Original line number Diff line number Diff line
@@ -3738,6 +3738,11 @@ final class ActivityStack {

    final boolean navigateUpToLocked(ActivityRecord srec, Intent destIntent, int resultCode,
            Intent resultData) {
        if (srec.app == null || srec.app.thread == null) {
            // Nothing to do if the caller is not attached, because this method should be called
            // from an alive activity.
            return false;
        }
        final TaskRecord task = srec.task;
        final ArrayList<ActivityRecord> activities = task.mActivities;
        final int start = activities.indexOf(srec);
+16 −1
Original line number Diff line number Diff line
@@ -1026,6 +1026,8 @@ class ActivityStarter {
        } else {
            callingPid = callingUid = -1;
        }
        boolean forceNewTask = false;
        final int filterCallingUid = callingUid >= 0 ? callingUid : realCallingUid;
        final long origId = Binder.clearCallingIdentity();
        try {
            synchronized (mService) {
@@ -1045,6 +1047,9 @@ class ActivityStarter {

                    // Don't modify the client's object!
                    intent = new Intent(intent);
                    if (forceNewTask) {
                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    }

                    // Collect information about the target of the Intent.
                    ActivityInfo aInfo = mSupervisor.resolveActivity(intent, resolvedTypes[i], 0,
@@ -1070,7 +1075,17 @@ class ActivityStarter {
                        return res;
                    }

                    resultTo = outActivity[0] != null ? outActivity[0].appToken : null;
                    final ActivityRecord started = outActivity[0];
                    if (started != null && started.getUid() == filterCallingUid) {
                        // Only the started activity which has the same uid as the source caller can
                        // be the caller of next activity.
                        resultTo = started.appToken;
                        forceNewTask = false;
                    } else {
                        // Different apps not adjacent to the caller are forced to be new task.
                        resultTo = null;
                        forceNewTask = true;
                    }
                }
            }
        } finally {