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

Commit a4f4a831 authored by sallyyuen's avatar sallyyuen Committed by Sally Yuen
Browse files

[EXO] Create a service connection for proxies

A proxy will give a privileged app access to a11y data typically available to AccessibilityServices. (Refer to the design doc linked in the comments for more information.)

A proxy will easily be able to set modify a list of service infos
depending on what a11y services/features are running on the client
device.

Introduce the system connection for a proxy:

- The service connection needs to maintain a single info that
represents this proxy-supplied list, so merge list values.

- Populate properties for each listed info that are default populated
for services installed on the device. This will prevent exceptions if
an app accesses these properties.

- Make setAccessibilityTool a SystemAPI, so a proxy can set this if it
needs to, since it cannot set this before runtime.

Test: builds, atest ProxyAccessibilityServiceConnectionTest
Bug: 241429275
Change-Id: Id99e2fa08be567738751d7a9a84f0014279924a1
parent 59199f53
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -462,6 +462,14 @@ package android {
}
package android.accessibilityservice {
  public class AccessibilityServiceInfo implements android.os.Parcelable {
    method public void setAccessibilityTool(boolean);
  }
}
package android.accounts {
  public class AccountManager {
+0 −1
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ package android.accessibilityservice {

  public class AccessibilityServiceInfo implements android.os.Parcelable {
    method @NonNull public android.content.ComponentName getComponentName();
    method public void setAccessibilityTool(boolean);
  }

}
+9 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
@@ -809,6 +810,13 @@ public class AccessibilityServiceInfo implements Parcelable {
        mComponentName = component;
    }

    /**
     * @hide
     */
    public void setResolveInfo(@NonNull ResolveInfo resolveInfo) {
        mResolveInfo = resolveInfo;
    }

    /**
     * @hide
     */
@@ -1128,7 +1136,7 @@ public class AccessibilityServiceInfo implements Parcelable {
     *
     * @hide
     */
    @TestApi
    @SystemApi
    public void setAccessibilityTool(boolean isAccessibilityTool) {
        mIsAccessibilityTool = isAccessibilityTool;
    }
+472 −0

File added.

Preview size limit exceeded, changes collapsed.

+211 −0

File added.

Preview size limit exceeded, changes collapsed.