-1

I have an app where you can calculate your calories.

I want to make a blind Mode, so if someone use this app who is blind, then the app does not need to show him a diagram.

I need to check on the phone if the blind mode is active or not (is Talkback activ).

How can I do this and check this permission.

I have tried this code but it does not work

Intent screenReaderIntent = new Intent("android.accessibilityservice.AccessibilityService");
screenReaderIntent.addCategory("android.accessibilityservice.category.FEEDBACK_SPOKEN");

List<ResolveInfo> screenReaders = getPackageManager().queryIntentServices(screenReaderIntent, 0);

Cursor cursor = null;

ContentResolver cr = getContentResolver();

for (ResolveInfo screenReader : screenReaders) {
cursor = cr.query(Uri.parse("content://" +      screenReader.serviceInfo.packageName
        + ".providers.StatusProvider"), null, null, null, null); 
TylerH
  • 20,799
  • 66
  • 75
  • 101
A.Meyer
  • 1
  • 1

1 Answers1

1

You're thinking about this completely the wrong way. By doing this you would be breaking the accessibility of your app. Remember, accessibility isn't only about how non-sighted users, use your application. There are a huge set of different disabilities. What about partially sighted users? Or those with dyslexia? Users who have no trouble seeing, but use TalkBack to have text read out to them, because it is more convenient for them than zoom features?

Separate is NOT equal. You should do your best to make your diagram accessible with TalkBack.

There are a few exceptions to this thought process, however, I do not believe this is one of them. To find the information you want you should do this:

Settings.Secure.getInt(this.getContentResolver(),android.provider.Settings.Secure.ACCESSIBILITY_ENABLED);
MobA11y
  • 18,425
  • 3
  • 49
  • 76