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

Commit d2954720 authored by Adam He's avatar Adam He
Browse files

Destroy remote service when CCService dies.

Remote services were still reconnecting back to the CCService when it is
restarted. This prevents multiple CCPerUserService/RemoteService staying
alive and clogging resources.

Fixes: 127662995
Test: atest CtsContentCaptureServiceTestCases
Test: manual verification
Change-Id: Idc5835594ebeb3ed245685189da11cff9799e62e
parent 463b5d19
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -389,6 +389,9 @@ final class ContentCapturePerUserService
    @GuardedBy("mLock")
    public void destroyLocked() {
        if (mMaster.debug) Slog.d(TAG, "destroyLocked()");
        if (mRemoteService != null) {
            mRemoteService.destroy();
        }
        destroySessionsLocked();
    }

+0 −3
Original line number Diff line number Diff line
@@ -280,9 +280,6 @@ public abstract class AbstractMasterSystemService<M extends AbstractMasterSystem
                oldService.removeSelfFromCacheLocked();
            }
            mServiceNameResolver.setTemporaryService(userId, componentName, durationMs);

            // Must update the service on cache so its initialization code is triggered
            updateCachedServiceLocked(userId);
        }
    }