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

Commit 6995921b authored by Vairavan Srinivasan's avatar Vairavan Srinivasan Committed by Steve Kondik
Browse files

frameworks/base: release references in ActivityManagerService

Fix to release references of HistoryRecord in Pending Activity list,
Activity History list, Pending Intents list, Connection Records
list of Service.

CRs-Fixed: 266817

Change-Id: I9189934a27a036757cdf4b0f721cdec35afd6f07
parent 18bc2894
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2069,6 +2069,9 @@ public final class ActivityManagerService extends ActivityManagerNative
            mMainStack.startActivityUncheckedLocked(pal.r, pal.sourceRecord,
                    pal.grantedUriPermissions, pal.grantedMode, pal.onlyIfNeeded,
                    doResume && i == (N-1));
            pal.r = null;
            pal.sourceRecord = null;

        }
        mPendingActivityLaunches.clear();
    }
@@ -2568,6 +2571,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                    mMainStack.mHistory.remove(i);

                    r.inHistory = false;
                    r.resultTo = null;
                    mWindowManager.removeAppToken(r);
                    if (VALIDATE_TOKENS) {
                        mWindowManager.validateAppTokens(mMainStack.mHistory);
@@ -9096,6 +9100,10 @@ public final class ActivityManagerService extends ActivityManagerNative
                TAG, "Removed service that is not running: " + r);
        }

        if (r.connections.size() > 0) {
            r.connections.clear();
        }

        if (r.bindings.size() > 0) {
            r.bindings.clear();
        }
+8 −1
Original line number Diff line number Diff line
@@ -2940,7 +2940,10 @@ public class ActivityStack {
        // because clients have remote IPC references to this object so we
        // can't assume that will go away and want to avoid circular IPC refs.
        r.results = null;
        if(r.pendingResults != null) {
           r.pendingResults.clear();
           r.pendingResults = null;
        }
        r.newIntents = null;
        r.icicle = null;
        
@@ -3075,6 +3078,7 @@ public class ActivityStack {
                    mService.cancelIntentSenderLocked(rec, false);
                }
            }
            r.pendingResults.clear();
            r.pendingResults = null;
        }

@@ -3098,6 +3102,7 @@ public class ActivityStack {
        if (r.state != ActivityState.DESTROYED) {
            mHistory.remove(r);
            r.inHistory = false;
            r.resultTo = null;
            r.state = ActivityState.DESTROYED;
            mService.mWindowManager.removeAppToken(r);
            if (VALIDATE_TOKENS) {
@@ -3119,6 +3124,7 @@ public class ActivityStack {
                ConnectionRecord c = it.next();
                mService.removeConnectionLocked(c, null, r);
            }
            r.connections.clear();
            r.connections = null;
        }
    }
@@ -3239,6 +3245,7 @@ public class ActivityStack {
            if (r.app == app) {
                if (localLOGV) Slog.v(TAG, "Removing this entry!");
                list.remove(i);
                r.resultTo = null;
            }
        }
    }