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

Commit 5b718616 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add a property for the declarition of accessibility purpose" into sc-dev

parents d8bcc207 5e3e603b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -818,6 +818,7 @@ package android {
    field public static final int installLocation = 16843447; // 0x10102b7
    field public static final int interactiveUiTimeout = 16844181; // 0x1010595
    field public static final int interpolator = 16843073; // 0x1010141
    field public static final int isAccessibilityTool = 16844353; // 0x1010641
    field public static final int isAlwaysSyncable = 16843571; // 0x1010333
    field public static final int isAsciiCapable = 16843753; // 0x10103e9
    field public static final int isAuxiliary = 16843647; // 0x101037f
@@ -3102,6 +3103,7 @@ package android.accessibilityservice {
    method public int getNonInteractiveUiTimeoutMillis();
    method public android.content.pm.ResolveInfo getResolveInfo();
    method public String getSettingsActivityName();
    method public boolean isAccessibilityTool();
    method public String loadDescription(android.content.pm.PackageManager);
    method public CharSequence loadSummary(android.content.pm.PackageManager);
    method public void setInteractiveUiTimeoutMillis(@IntRange(from=0) int);
+22 −0
Original line number Diff line number Diff line
@@ -579,6 +579,13 @@ public class AccessibilityServiceInfo implements Parcelable {
     */
    private int mHtmlDescriptionRes;

    /**
     * Whether the service is for accessibility.
     *
     * @hide
     */
    private boolean mIsAccessibilityTool = false;

    /**
     * Creates a new instance.
     */
@@ -708,6 +715,8 @@ public class AccessibilityServiceInfo implements Parcelable {
            if (peekedValue != null) {
                mHtmlDescriptionRes = peekedValue.resourceId;
            }
            mIsAccessibilityTool = asAttributes.getBoolean(
                    R.styleable.AccessibilityService_isAccessibilityTool, false);
            asAttributes.recycle();
        } catch (NameNotFoundException e) {
            throw new XmlPullParserException( "Unable to create context for: "
@@ -1035,6 +1044,15 @@ public class AccessibilityServiceInfo implements Parcelable {
                || mResolveInfo.serviceInfo.directBootAware;
    }

    /**
     * Indicates if the service is used to assist users with disabilities.
     *
     * @return {@code true} if the property is set to true.
     */
    public boolean isAccessibilityTool() {
        return mIsAccessibilityTool;
    }

    /**
     * {@inheritDoc}
     */
@@ -1061,6 +1079,7 @@ public class AccessibilityServiceInfo implements Parcelable {
        parcel.writeInt(mAnimatedImageRes);
        parcel.writeInt(mHtmlDescriptionRes);
        parcel.writeString(mNonLocalizedDescription);
        parcel.writeBoolean(mIsAccessibilityTool);
    }

    private void initFromParcel(Parcel parcel) {
@@ -1082,6 +1101,7 @@ public class AccessibilityServiceInfo implements Parcelable {
        mAnimatedImageRes = parcel.readInt();
        mHtmlDescriptionRes = parcel.readInt();
        mNonLocalizedDescription = parcel.readString();
        mIsAccessibilityTool = parcel.readBoolean();
    }

    @Override
@@ -1136,6 +1156,8 @@ public class AccessibilityServiceInfo implements Parcelable {
        stringBuilder.append(", ");
        stringBuilder.append("summary: ").append(mNonLocalizedSummary);
        stringBuilder.append(", ");
        stringBuilder.append("isAccessibilityTool: ").append(mIsAccessibilityTool);
        stringBuilder.append(", ");
        appendCapabilities(stringBuilder, mCapabilities);
        return stringBuilder.toString();
    }
+9 −0
Original line number Diff line number Diff line
@@ -3853,6 +3853,15 @@
        <!-- Attribute whether the accessibility service wants to be able to take screenshot. -->
        <attr name="canTakeScreenshot" format="boolean" />
        <!-- Attribute indicating whether the accessibility service is used to assist users with
             disabilities. This criteria might be defined by the installer. The default is false.
             <p>
             Note: If this flag is false, system will show a notification after a duration to
             inform the user about the privacy implications of the service.
             </p>
        -->
        <attr name="isAccessibilityTool" format="boolean" />
        <!-- Animated image of the accessibility service purpose or behavior, to help users
             understand how the service can help them.-->
        <attr name="animatedImageDrawable" format="reference"/>
+1 −0
Original line number Diff line number Diff line
@@ -3087,6 +3087,7 @@
    <public name="dataExtractionRules"/>
    <public name="passwordsActivity"/>
    <public name="selectableAsDefault"/>
    <public name="isAccessibilityTool"/>
  </public-group>

  <public-group type="drawable" first-id="0x010800b5">