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

Commit f151e30a authored by Guojing Yuan's avatar Guojing Yuan
Browse files

Mark IOnAssociationsChangedListener as oneway

System process shouldn't be blocked by client execution.

Fix: 363168094
Flag: EXEMPT bugfix
Test: m build
Change-Id: I653fb72eb4a2dd3e763ec29aa10426d43d420b8d
parent ea26939a
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -19,23 +19,6 @@ package android.companion;
import android.companion.AssociationInfo;

/** @hide */
interface IOnAssociationsChangedListener {

    /*
     * IMPORTANT: This method is intentionally NOT "oneway".
     *
     * The method is intentionally "blocking" to make sure that the clients of the
     * addOnAssociationsChangedListener() API (@SystemAPI guarded by a "signature" permission) are
     * able to prevent race conditions that may arise if their own clients (applications)
     * effectively get notified about the changes before system services do.
     *
     * This is safe for 2 reasons:
     *  1. The addOnAssociationsChangedListener() is only available to the system components
     *     (guarded by a "signature" permission).
     *     See android.permission.MANAGE_COMPANION_DEVICES.
     *  2. On the Java side addOnAssociationsChangedListener() in CDM takes an Executor, and the
     *     proxy implementation of onAssociationsChanged() simply "post" a Runnable to it.
     *     See CompanionDeviceManager.OnAssociationsChangedListenerProxy class.
     */
oneway interface IOnAssociationsChangedListener {
    void onAssociationsChanged(in List<AssociationInfo> associations);
}
 No newline at end of file