Giter Site home page Giter Site logo

accessibility-insights-for-android-service's Introduction

Accessibility Insights for AndroidTM Service

Build Status

Accessibility Insights for Android Service is a service for Android that helps in assessing the accessibility of Android applications.

Notice

The Accessibility Insights team is proud to provide accessibility scanning solutions across multiple platforms including Web, Windows Desktop, and Android. Unfortunately, the usage of Accessibility Insights for Android did not meet expectations and we will be ending support of that product effective June 1 2023, so we can focus on our more popular products for Web and Windows Desktop. The product download link will be removed to promote security and discourage use of an unmaintained version of the product. The source code will remain available under the MIT open-source license. We are grateful to the community who continue to use our accessibility testing products!

Building the code

Prerequisites

  • Download and install Android Studio

    • If you plan on using Android Studio's emulator, make sure "Android Virtual Device" is checked in the download setup dialog
    • Selecting the standard installation (recommended) will also install Android SDK tools
  • Emulator (optional, if not using a physical device):

    • From Android Studio, start Android Virtual Device (AVD) Manager: Tools > AVD Manager
    • Select Create Virtual Device. This may require downloading the selected system image. If possible, select a newer device, such as Pixel 3 API 29 .

Note: We do not recommend using a personal Android device for testing and development; we recommend using a testing device or emulator. Software under development may not yet be fully secure, and many development tools require permissions that could present a potential risk to your device and data.

Setup (Windows, Linux, Mac)

While the instructions for Windows, Linux, and Mac are the same, the instructions below are written with Windows-style file paths.

  1. Fork and clone the repository

  2. Open the project with Android Studio

    • This must be the Android project AccessibilityInsightsForAndroidService inside the repo, not the top-level accessibility-insights-for-android-service folder
  3. The project will automatically sync and build

  4. Change the launch options in Android Studio:

    • Under the Run menu, select Edit configurations...
      • Ensure that the app is selected in the left navigation pane
      • Under General > Launch Options, change Launch from "Default Activity" to "Nothing"
      • Select Apply, then Ok
  5. Run the app from Android Studio (this will install the APK onto the emulator). The app won't show up in the list of programs--it shows up as a downloaded accessibility service. It will be off by default. To activate it:

    • Open the Settings app in the emulator. If you have trouble opening the emulator, see Unable to start emulator under Known Issues below
    • Scroll down and select Accessibility
    • Select "Accessibility Insights for Android Service" under Downloaded services
    • Toggle on Use service to enable the service
    • Select Allow on the resulting dialog to grant the necessary permissions
    • An "Exposing sensitive info during casting/recording" dialog should appear. Select Start now

Triggering requests in adb

While the service is running, you can manually trigger requests by invoking the following adb shell content commands:

  • Config

    • adb shell content read --uri content://com.microsoft.accessibilityinsightsforandroidservice/config
    • Returned data includes:
      • deviceName - the name of the device from the Android Build.MODEL
      • packageName - the package the associated root AccessibilityInfoNode comes from
      • serviceVersion - the version of the service
  • Raw Axe and ATFA Results (results version 2)

    • adb shell content read --uri content://com.microsoft.accessibilityinsightsforandroidservice/result
    • Returned data includes:
      • AxeResults
        • axeConf - the set AxeConf object listing which rules will run
        • axeContext - the Context axe-android is running the rules on
          • axeDevice - the device the context was built on
          • axeEventStream - the AccessibilityEvent Stream since the last view refresh
          • axeMetadata
            • analysisTimestamp - the timestamp at time of analysis
            • appIdentifier - the Android PackageName
            • axeVersion - implementation version of package
            • screenTitle - title of current screen
          • axeView - the serializable view hierarchy at the time the context was built
          • screenshot - the screenshot at the time the Context was built (this will display as a wall of text BitMap in the browser)
        • axeRuleResults - an array of AxeRuleResult objects. Each has:
          • axeViewId - the ID of the view it's associated with (corresponds to a view listed above in axeContext)
          • impact - the severity of the issue
          • props - the properties used in determining the outcome
          • ruleId - the ID of the rule
          • ruleSummary - short summary of the rule.
          • status - the status of the rule (PASS, FAIL, etc)
      • ATFARules - an array of AccessibilityHierarchyCheck objects. Each has:
        • class - the name of the class for the check
        • titleMessage - the human-readable title of the check
        • category - the type of accessibility check (see Category)
        • helpUrl - the URL for a help article related to the check
        • resultIdsAndMetadata - a map providing possible result IDs and additional metadata about the check
      • ATFAResults- an array of AccessibilityHierarchyCheckResult objects. Each has:
        • AccessibilityHierarchyCheckResult.element - a ViewHierarchyElement object corresponding to the result
        • AccessibilityHierarchyCheckResult.resultId - an ID grouping all results from a single class
        • AccessibilityCheckResult.checkClass - the name of the class for the check which reported the result
        • AccessibilityCheckResult.type - the status of the result (see AccessibilityCheckResultType)
        • AccessibilityHierarchyCheckResult.metadata - an object which implements ResultMetadata containing additional information about the result

Known issues

Gradle sync fails

Restarting Android Studio and waiting for everything to load before building the project could solve the issue

  • Error message: Cannot find symbol.

    • Sometimes the issue is caused because the file path exceeded the maximum number of characters allowed, so you could try to shorten the path by changing the location of the project folder on your computer.
SDK setup issues
  • Error message: Failed to install the following Android SDK packages as some licences have not been accepted.

    • Select the "Install missing SDK package(s)" link at the end of the error message. Follow the prompt to agree to license terms and install missing SDK tools
Unable to start emulator
  • (Windows) Error message: Intel HAXM is required to run this AVD. VT-x is disabled in BIOS. Enable VT-x in your BIOS security settings (refer to documentation for your computer).

    • Virtualization might not be enabled on your computer. To check if it is, open Task Manager and select the Performance tab. If "Virtualization" is disabled, follow these instructions to enable virtualization in your BIOS. The option to enable virtualization might be under "Security settings"

    • Sometimes the issue is caused by Hyper-V blocking other virtualization apps, so you could also try to turn off Hyper-V.

  • (Linux) Error message: KVM is required to run this AVD. /dev/kvm device: permission denied. Grant current user access to /dev/kvm

    • Open a Terminal window and run the following:
      sudo apt install qemu-kvm
      sudo adduser $USER kvm
    • Restart your machine

Migrating from version 1.x

  • The communication protocol in 1.x was "use adb forward to access an http server on the device". This method has been removed in 2.x and replaced with the adb shell content commands listed above.
  • The "v1" results API (which included only Axe results and not ATFA results) was removed in 2.x and replaced with the v2 results API which also includes ATFA results.

Reporting security vulnerabilities

If you believe you have found a security vulnerability in this project, please follow these steps to report it. For more information on how vulnerabilities are disclosed, see Coordinated Vulnerability Disclosure.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Contributing

All contributions are welcome! Please read through our guidelines on contributions to this project.

Code of Conduct

Please read through our Code of Conduct to this project.

Android is a trademark of Google LLC.

accessibility-insights-for-android-service's People

Contributors

ada-cat avatar ahmedabdoortiga avatar brocktaylor7 avatar codeofdusk avatar davetryon avatar dbjorge avatar dependabot[bot] avatar devaradhanm avatar ferbonnin avatar github-actions[bot] avatar jalkire avatar jamiemagee avatar jgibson2019 avatar karanbirsingh avatar lisli1 avatar madalynrose avatar microsoftopensource avatar pownkel avatar sfoslund avatar thanyaleif avatar waabid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accessibility-insights-for-android-service's Issues

Query on Accessibility Insights Potentially Flagging Issues From Other Pages

Hi, we would like to make a few queries on WCAG potentially flagging issues on other pages of the mobile app, when the elements in question are not present on those pages.

In this post, I am asking 3 overarching questions (labelled as 'Examples', as I am sharing the context before asking the follow-up sub-questions). Hence this post might be a little long. Please bear with us :)

Thank you in advance and please feel free to reach out if further information is required. However, we won't be able to share the app details as the app requires login details that are confidential.

Example 1

When scanning Mobile App A for WCAG 1.3.1, WCAG 3.3.2, the elements raised in the following screens are shown in step 1 of the form submission.

App A - 131 - 1b

We believe these are the elements flagged by AIFA as issues:
App A - 131 - 1c

However, on the confirmation screen on step 2, these elements are not present. Yet they are flagged by Accessibility Insights as issues
App A - 131 - 2

This is how the screen looks like without the visual helper
App A - 131 - 2b

Questions For Example 1

  1. May we know what is causing Accessibility Insights to flag these WCAG issues on Step 2 of the mobile app when the flagged elements are not present?
  2. Do these ‘flagged’ issues raise any potential accessibility issues? Or can these be ignored?
  3. App owner claims that assistive technologies are already in place for Step 2 pages. Is there any way we could validate this? What does Microsoft recommend?

Example 2

The following are errors flagged when we scan the following pages for WCAG. For context, this is a page where the mobile app is supposed to calculate wages contribution for the user after the user keys in the required information.

These are the issues flagged in Step 1 of 2
App A - SC - AIFA

The same issues are flagged in Step 2 of 2. However, the elements are not present on this page
App A - SC - AIFA Step 2a
App A - SC - AIFA Step 2b

Questions For Example 2

  1. May we know what is causing Accessibility Insights to flag these WCAG issues on Step 2 of the mobile app when the elements are not present?
  2. Do these ‘flagged’ issues raise any potential accessibility issues? Or can these be ignored?
  3. App owner claims that assistive technologies are already in place for Step 2 pages. Is there any way we could validate this? What does Microsoft recommend?

Example 3

This is a page with 2 tabs: Citizen and Permanent Resident, meaning, they share the same page on the mobile app.

These are the errors flagged when we scanned the Citizen page:
App A - SC - AIFA

These are the errors flagged when we scan the Permanent Resident page. As you can see, the errors on the Permanent Resident tab is the same as the Citizen’s tab

if the entries are filled on the Citizen’s tab, the information will be ported over when we select the Permanent Resident’s tab
App A - PR - AIFA

Questions For Example 3

  1. In such instances, could it be possible that the elements flagged by Accessibility Insights are the same between the 2 tabs – and if the app owner rectifies the source issue, the accessibility issue should be resolved on both tabs of the mobile app? Or;
  2. Should we advise the app owner to treat each tab’s finding as separate entities and rectify the codes accordingly?

versionCode was set incorrectly in v1.1.0

Describe the bug

Android uses an integer versionCode property as the means for APKs to specify to Android which version of an app they represent. Android requires that this versionCode increase when a new version is released; that's how it determines (either via the store or via adb) whether a new package represents an "upgrade" or a "downgrade".

We use semantic versioning with our releases for the versionName, and our release template defines a strategy for determining the versionCode from the versionName (for versionName xx.yy.zz, we use versionCode xxyyzz, ie, v1.1.0 should use versionCode 010100).

Unfortunately, right now our release process has humans hand-write the versionName and versionCode in our release build pipeline parameters, and the versionCode that was actually used in v1.1.0 was 011000, not 010100. This means that any future v1.1.1 through v1.10.0 would not end up increasing the versionCode if they were to release using the previous versionCode strategy.

This bug tracks both:

  • Working around the issue by updating our versionName -> versionCode strategy (to format XXYYZZZ rather than XXYYZZ)
  • Automating the determination of the versionCode from the versionName in release-build.yaml, to prevent this specific problem from happening again
  • Adding a check to release-build.yaml that the version specified is greater than any previously released version, to prevent similar classes of issues from happening again (we need to do this manually since we aren't distributing through a store/package repository that enforces this on our behalf, like for most of our other projects)

[bug]: Service throws an exception with some apps

Describe the bug

Some apps, like Flipgrid in camera view, throw an exception inside axe-android. We've reported this exception to deque at dequelabs/axe-android#127, but we can also add a workaround on our side until the bug is fixed.

To Reproduce
Steps to reproduce the behavior:

  1. Launch FlipGrid on your device.
  2. Start Accessibility Insights for Android
  3. Scan FlipGrid--it completes successfully
  4. Tap the camera icon on FlipGrid
  5. Press the "Start Over" button in Accessibility Insights for Android

Actual behavior:

You get a "device disconnected" message

Expected behavior

You should get a scan of the camera page, including issues (there are several touch size violations, for example)

Context (please complete the following information)

  • Android Version: 10
  • Service Version & Environment: 2020.1124.4
  • Target Application: Flipgrid 9.2.0

Here's the actual exception being thrown:

An Exception was thrown!
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference at
com.deque.axe.android.AxePropCalculator.getCalculatedProps(AxePropCalculator.java:56) at
com.deque.axe.android.AxeView.calculateProps(AxeView.java:429) at
com.deque.axe.android.AxeView.(AxeView.java:194) at
com.deque.axe.android.AxeView.(AxeView.java:208) at
com.deque.axe.android.AxeView$Builder.build(AxeView.java:156) at
com.microsoft.accessibilityinsightsforandroidservice.AxeViewsFactory.buildAxeViews(AxeViewsFactory.java:69) at
com.microsoft.accessibilityinsightsforandroidservice.AxeViewsFactory.buildAxeViewsWithRetries(AxeViewsFactory.java:41) at
com.microsoft.accessibilityinsightsforandroidservice.AxeViewsFactory.createAxeViews(AxeViewsFactory.java:32) at
com.microsoft.accessibilityinsightsforandroidservice.AxeContextFactory.createAxeContext(AxeContextFactory.java:30) at
com.microsoft.accessibilityinsightsforandroidservice.AxeScanner.scanWithAxe(AxeScanner.java:24) at
com.microsoft.accessibilityinsightsforandroidservice.ResultRequestFulfiller.getScanContent(ResultRequestFulfiller.java:68) at
com.microsoft.accessibilityinsightsforandroidservice.ResultRequestFulfiller.lambda$fulfillRequest$0$ResultRequestFulfiller(ResultRequestFulfiller.java:39) at
com.microsoft.accessibilityinsightsforandroidservice.-$$Lambda$ResultRequestFulfiller$yG6us3t3DTAXfswnmqRdFfQBoSE.accept(Unknown Source:6) at
com.microsoft.accessibilityinsightsforandroidservice.ScreenshotController.lambda$getImageReader$0$ScreenshotController(ScreenshotController.java:78) at
com.microsoft.accessibilityinsightsforandroidservice.-$$Lambda$ScreenshotController$7og7qnDPiWyGIKAMcU5BF-Q6rTk.accept(Unknown Source:6) at
com.microsoft.accessibilityinsightsforandroidservice.OnScreenshotAvailable.onImageAvailable(OnScreenshotAvailable.java:51) at
android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:798) at
android.os.Handler.dispatchMessage(Handler.java:107) at
android.os.Looper.loop(Looper.java:237) at
android.os.HandlerThread.run(HandlerThread.java:67)

Are you willing to submit a PR?

Yes

Did you search for similar existing issues?

Yes--this has the same symptom as #61 (closed for lack of response from the filer), but it may or may not be the same root cause.

Additional context

Questions Regarding android.widget.FrameLayout

Hi Accessibility Insights for Android team, we have 2 questions regarding a class name that was flagged in our WCAG checks.

  1. May we check what does Class Name android.widget.FrameLayout mean?
    2a) what is a definition of an android.widget.FrameLayout

2b where is the specific location on the mobile app is AIFA highlighting?

2c) what should we do to rectify this issue?

Please find the corresponding screenshots of this encounter:
WCAG frame layout 1

WCAG frame layout 2

As this mobile app requires a login, we are unable to share these details with the AFIA team. However, we would appreciate it if you could provide us with some insights into this.

If the team needs more details, we will be happy to schedule a zoom call to show the team the issue encountered.

"Highlight Unavailable" Issues Flagged By AIFA

Hi, I have a follow-up question from the issue I posted previously: See link, Question 2 on Highlights Unvailable

Our client got back to us with regard to a 'highlight unavailable' issue detected by Accessibility Insights. We had previously advised our client to check their codes for accessibility issues and to rectify them. The client's developers was unable to locate these issues. Please see screenshots below for their comments. We would like to seek some advice on what the developers should do for their next steps to rectify the following issues:

Issue 1:
Issue 1

Client's comment:
The view here is not visible so it will not impact accessibility target users. We are not detecting any error so please clarify the image object that is causing this issue.

Daphne's question to Microsoft:
We were unable to advise on the specific location flagged by Accessibility Insight for the WCAG error captured due to unavailable highlights. Is it safe to assume that if a view is not visible, users who rely on accessibility tools will not be impacted? We believe the client's developers have checked their codes backend as well but are unable to detect any further issues as well.

Issue 2:
Issue 2

Client's comment:
Please clarify which edit field AIFA is pointing to. The edit area only comes out after we tap on the search icon. Hence, the current view should suffice.

(Daphne's additional notes to Microsoft: We have scanned the page when the edit textbox should appear only to encounter the same error)
Issue 3

Questions on next steps for both Issues 1 & 2
Initially, we advised the client's developers to check their codes backend for any WCAG issues since it was not detectable by Accessibility Insights. The client's developer had since done so but is unable to identify any issues.

  1. Since we are unable to advise on the location of the issue flagged, please advise on the next step on what should be done on the developer's end to troubleshoot the issue and rectify the WCAG error flagged?

  2. Just because a view is not visible, is it safe to assume that users who rely on accessibility tools will not be affected despite WCAG issue being flagged by Accessibility Insights?

Unfortunately, we are unable to share the login details of this mobile app as private confidential is required.

Greatly appreciate your response. Thank you!

Unable to run Android Service "WorkManager is not initialized properly"

Describe the bug

Got a fatal exception when trying to run Accessibility Insights for Android service: WorkManager is not initialized properly

To Reproduce
Steps to reproduce the behavior:

  1. Open the AI for Android Service on Android Studio
  2. Run app (Shift + F10)
  3. Wait until the app gets installed in the emulator
  4. Open the Settings app in the emulator.
  5. Scroll down and select Accessibility
  6. Select "Accessibility Insights for Android Service" under Downloaded services
  7. Toggle on Use service to enable the service
  8. Select Allow on the resulting dialog to grant the necessary permissions
  9. The service crashes

Expected behavior

An "Exposing sensitive info during casting/recording" dialog should appear. And the app should start running after hitting the button "Start now"

Screenshots

image

Additional context

Using the latest released version of the service (v2.0.0) worked.
The problem was introduced in the last few months after that.

focus tracking gets confused when the screen is rotated

Describe the bug

Our cache of previously focused items becomes invalid when the display dimensions change

To Reproduce
Steps to reproduce the behavior:

  1. Go to AIAndroid
  2. Click on Start focus tracking (I used the calculator app)
  3. Hit tab a few times to build up a history of focused items
  4. Rotate the device
  5. The tracking history changes, and if the screen dimensions change (a 90 degree rotation, for example), the previous positions are from the old rotation, not the current rotation.

Expected behavior

I'm not sure what should happen--maybe clear the history or disable focus tracking?

Screenshots

Image in landscape mode:
image

Image after rotating to portrait mode:
image

Context (please complete the following information)

  • Android Version: Android 10 (Samsung Tab S4)
  • Service Version & Environment: Installed with AI Android 2021.331.1 Insider
  • Target Application: Android Calculator

Are you willing to submit a PR?

Did you search for similar existing issues?

Additional context

Accessibility Insights Screens Disconnecting

We encourage tool related questions to be asked on stackoverflow.com and tagged with accessibility-insights.

Hi I have a query regarding Accessibility Insights For Android. We are running WCAG tests for a few mobile apps. However, we are encountering scenarios where the mobile app disconnects whenever we load a certain screen on the mobile app

  • Example 1: For App 1, Accessibility Insights disconnects when I try to load the Insert Credit Card page screen
  • Example 2: For App 2, Accessibility Insights disconnects when I try to load the I load the FAQ page screen

However, all other screens works while scanning the apps within the same sitting. We have also tried scanning the same screens across a couple of laptops with the same problem.

May I know what possible reasons could there be for such cases? Does it have to do with the codes done on the mobile app backend?

This is the screenshot received:
image

Appreciate your advice. Thank you!

Screenshot fails on M1 Mac

Describe the bug

On an M1 Mac, when using the emulator, the service fails to take a screenshot. The screenshot succeeds when using a physical android device, so this is likely a bug in the emulator. Filing this bug to investigate whether that is the case, and if it is, create a minimal repro to file the bug with Android Studio.

After some investigation with @katydecorah, we know that the original bitmap that we get from the screenshot API is an empty image. However, when we tried to repro the same bug on a different screenshot app, the screenshot was taken successfully, so the bug may only exist in some versions of Android, or when a screenshot is taken in the specific way that our service does.

To Reproduce

With the Accessibility Insights client:

  1. On an M1 Mac, start Android Studio
  2. From the top menu, select run > Select device > device manager > Create device. Follow the steps to create a Pixel 3a emulator (with Android API 33).
  3. Still in the device manager window, select the "run" icon next to the Pixel 3a device
  4. Launch the Accessibility Insights for Android client. Follow the onscreen steps to connect to the emulator. (Note that if you already have the A11y Insights for Android service installed on the emulator, the client will force an update to the most recent production version, so the client cannot be used for dev testing the service)
  5. Run an automated checks scan
  6. Observe that the screenshot is blank

Without the Accessibility Insights client:

  1. On an M1 Mac, open the project in Android Studio
  2. From the top menu, select run > Select device > device manager > Create device. Follow the steps to create a Pixel 3a emulator (with Android API 33). Make sure this device is selected in the dropdown next to the green "run" triangle button.
  3. Wait for the project to build
  4. Add a debugging breakpoint in onScreenshotAvailable.java just after the bitmap is created
  5. From the top menu, select run > debug
  6. Start the Accessibility Insights service and allow screen recording permissions
  7. From the top menu, select run > attach to debug process
  8. Use ADB to trigger a request to the service (adb shell content read --uri content://com.microsoft.accessibilityinsightsforandroidservice/result)
  9. Execution should stop on the breakpoint you set in step 3
  10. In the debug window, next to bitmap, click "view bitmap"
  11. Observe that the window shows a blank image

Expected behavior

We should be able to take a screenshot

Screenshots

2022-08-22 at 3 56 PM

Context (please complete the following information)

  • Android Version: 13 (API 33)
  • Service Version & Environment: 2.0.0 Production
  • Target Application: Any

Are you willing to submit a PR?

No (I don't have the device necessary to repro)

Did you search for similar existing issues?

Yes

Test Android 13 Accessibility API's restriction

To Reproduce
Use the service and client in Android 13

Expected behavior

Service should still work

Additional context

We might need to add a new step to AI4Android's install flow that uses an adb command to set the new "ACCESS_RESTRICTED_SETTINGS" permission to "allow"

Screenshots are output in wrong width on Moto G7 Power

Describe the bug

On some devices (I saw this on a Moto G7 Power), the screenshot image data returned from the service includes some padding on the right side that shouldn't be there:

image

The root cause of this is our logic for copying data from the Image that we get back from the screenshot-grabbing routines into a Bitmap suitable for passing as output from the service. Specifically, our logic is a little off for cases where the Image we are given has a getRowStride() different from its getWidth().

Here's the code in question:

private Bitmap getBitmapFromImage(Image image) {
Image.Plane[] imagePlanes = image.getPlanes();
int bitmapWidth = getBitmapWidth(image, imagePlanes);
Bitmap screenshotBitmap =
bitmapProvider.createBitmap(bitmapWidth, metrics.heightPixels, Bitmap.Config.ARGB_8888);
ByteBuffer buffer = imagePlanes[0].getBuffer();
screenshotBitmap.copyPixelsFromBuffer(buffer);
return screenshotBitmap;
}
private int getBitmapWidth(Image image, Image.Plane[] imagePlanes) {
int pixelStride = imagePlanes[0].getPixelStride();
int rowStride = imagePlanes[0].getRowStride();
int rowPadding = rowStride - pixelStride * metrics.widthPixels;
return image.getWidth() + rowPadding / pixelStride;
}

The issue occurs when rowStride is larger than the image width (ie, there is some empty padding in the raw pixel data at the end of each row). Our code is correctly accounting for the extra padding when it initially creates the the Bitmap, such that the Bitmap's backing data buffer will be sized appropriately to receive the original data including the extra padding. However, the resulting Bitmap doesn't understand that width != stride, so it treats the extra padding as part of the image; that empty padding is what you're seeing in the top screenshot (the padding is actually transparent pixels).

Unfortunately, Bitmap::copyPixelsFromBuffer doesn't have a variant that accepts a stride parameter. Bitmap::createBitmap and Bitmap::setPixels have variants that accept strides, but only in combination with other bitmaps or int[] data, and the buffer we get back from the original Image is a "direct" buffer that doesn't allow array-like to its underlying buffer array. We may need to either do an intermediate copy to our own array to use with createBitmap, or write our own stride-aware version copyPixelsFromBuffer.

To Reproduce
Steps to reproduce the behavior:

  1. Install the service on a Moto G7 Power
    note: we aren't sure whether it's the specific device or the specific display metrics that trigger Android to output the Image properties required for the repro; if you don't have access to this specific device, you might try creating an emulator with the same OS level (9 / Pie) and same DisplayMetrics (720x1520 320dpi)
  2. Use Accessibility Insights for Android (prod or dev are both fine) to run a scan
  3. Observe the extra padding and wrongly-offset failure highlighting

Expected behavior

No extra padding, failure highlights line up with elements

Context (please complete the following information)

  • Android Version: 9 (Pie)
  • Service Version & Environment: Repros in 1.1.0 and the 1.2.0 release candidate
  • Target Application: Any

Allow users to ignore/modify touch target sizes on certain elements

Is your feature request related to a problem? Please describe.

We chose to make the text in our react-native app selectable for copy/paste on long press (By using ReactNativeText components with "selectable" equal to true). Unfortunately, this results in all text being considered interactable and the number of errors from this hides actual errors I want to see.

Describe the desired outcome

I would like to be able to ignore this specific error (touch target size on selectable text).

Describe alternatives you've considered

Alternatively, we can turn off selectable text or reserve it for a select few lines of text that are important enough to meet the touch target size.

Additional context

This accessibility scanner is currently consistent with the Accessibility Scanner app from Google, which also marks this text as violating touch targets.

Errors Appearing Outside of Target App Screenshot

Hi GitHub

We are scanning the mobile apps on Accessibility Insight For Android. We are encountering issues where there are errors flagged outside of the mobile app (see Target app screenshot attached, highlighted in cyan).
Target App Screenshot

However, there are no further details outside the screen. May I know what is causing these flagged errors to appear?

If it helps, these are the element paths raised by the software for your reference (WCAG 1.3.1, 3.3.2).

  1. android.widget.TextView
  2. androidx.appcompat.app.ActionBar$Tab
  3. android.widget.LinearLayout
  4. android.widget.ImageButton
  5. android.widget.ImageView
  6. android.view.View

Thank you!
Daphne

Improve TempFileProvider cleanup

Is your feature request related to a problem? Please describe.

PR #126 added TempFileProvider for managing the ContentProvider's responses. Currently, it cleans up its temp files when the service is started and stopped. Ideally, it would perform ongoing cleanup while the service is running as well.

Describe the desired outcome

Temporary files will be cleaned up 5 minutes after they are created.

Additional context

This tracks a stretch goal from the andsvc-protocol feature.

Questions regarding exporting of results

Hi Accessibility Insights team,

I have some questions regarding the results export function for Accessibility Insights For Android.

1) May we know is there any way to export the results in .xlsx (excel file) format?
Currently, we understand we are able to access and download the HTML version of these results. We would like to check if there are other results export functions available.

2) May we also know if there is any way to export/ download the target app screenshots from Accessibility Insights?
Currently, we are manually taking screen captures of the target apps. So, we would like to know if a download option is available, which we are unaware of.

Thank you and we appreciate your reply.

Regards
Daphne

Issues Connecting Mobile Devices to Accessibility Insights For Android

Dear Accessibility Insights for Android team,

My team and I are trying to conduct WCAG checks for a couple of mobile apps. However, Accessibility Insights For Android's system cannot detect our devices.

This is not the first time we are using Accessibility Insights for Android. We were able to run WCAG checks with the software in 2020 successfully. So, we are not exactly sure what is the problem.

We have followed all the steps listed in this URL: https://accessibilityinsights.io/docs/android/getstarted/setup/#connect-to-your-android-device

However, the issue persists.

Other steps we had taken, to no avail:

  1. uninstall and install Accessibility Insights for Android

  2. Reset developer mode settings on our Android devices

  3. Updated the OS for the android devices

  4. Restart the PC / restart the mobile devices

  5. Reconnected the device multiple times

  6. Redownloaded the ABD file

For reference, this is the screen we are stuck on: (Selecting detect my device does nothing)
AIFA1

We appreciate your advice on any possible fixes we can take to proceed from here. We will be happy to provide more information if required. Thank you!

Advice Needed For WCAG 1.3.1, WCAG 3.3.2 (ActiveViewName) Fix

Dear Accessibility Insights team

We are trying to fix the accessibility issue: WCAG 1.3.1, WCAG 3.3.2 (ActiveViewName) identified by Accessibility Insights For Android (see screenshot below).

image

We have tried to address the issue by providing a description for the ActiveView (see the link for our output in video form below).

https://drive.google.com/file/d/1jSAUhIGyFlP3gnarUKv9_bDjsIeo0bQM/view?usp=sharing

However, the issue is still flagged by Accessibility Insights For Android.

May we know:

  1. Why is the WCAG issue still flagged by Accessibility Insights For Android?

  2. What have we not done correctly for the fix, and what should we do to correct it?

Greatly appreciate your assistance with this! Thank you.

focus tracking highlights are not vertically centered

Describe the bug

On some devices (I'm using a Samsung Galaxy Tab S4 but it's also occurred on others), the focus tracking highlights are not vertically centered on the View that received the focus. This may be related to differences in the heights of the top and bottom bars that exist on the display.

To Reproduce
Steps to reproduce the behavior:

  1. Start AI-Android
  2. Start tab stops tracking (I used calculator as my test app since the small buttons make it easy to spot the offset)
  3. Tab around the app and compare the highlight circles
  4. Compare the highlight positions to the View positions--they're horizontally centered, but not vertically centered (see screenshot):

Expected behavior

Highlights should be vertically centered on the View

Screenshots

image

Context (please complete the following information)

  • Android Version:
  • Service Version & Environment:
  • Target Application:

Are you willing to submit a PR?

Yes

Did you search for similar existing issues?

Yes

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.