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

Commit 539a08a4 authored by Haoran Zhang's avatar Haoran Zhang Committed by Mohammed Althaf T
Browse files

Implement onNullBinding() in autofill service connection

With this fix, an autofill service which returns null in onBind() will no longer stay bound by system_server and will no longer be able to launch activities from the background.

Flag: EXEMPT security bugfix
Test: sts-tradefed run sts-dynamic-develop -m StsHostTestCases -t android.security.sts.Bug_401545800
Bug:b/401545800
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d883efa912c0a39c46437074576cffb7078ac455)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:727898d7b32218f45414d68e84a973734f92a56c)
Merged-In: Ieb3e63fe2ac1f440be3d164730ef3110209ec1a6
Change-Id: Ieb3e63fe2ac1f440be3d164730ef3110209ec1a6
parent becf686c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -121,6 +121,14 @@ final class RemoteFillService extends ServiceConnector.Impl<IAutoFillService> {
        }
    }

    @Override // from ServiceConnection
    public void onNullBinding(@NonNull ComponentName name) {
        if (sVerbose) {
            Slog.v(TAG, "onNullBinding");
        }
        unbind();
    }

    private void dispatchCancellationSignal(@Nullable ICancellationSignal signal) {
        if (signal == null) {
            return;