diff options
author | Svetoslav <svetoslavganov@google.com> | 2015-01-16 15:42:58 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2015-01-21 18:28:03 +0000 |
commit | 76ff4dd0de8d9747b9341f064dd270c5762705c6 (patch) | |
tree | bee45cc33f2a6ec6534d4f81e47479589611fb3f /core/java/com | |
parent | 06ab0ca4812450ec297722957e18b34cbfa733b2 (diff) | |
download | frameworks_base-76ff4dd0de8d9747b9341f064dd270c5762705c6.zip frameworks_base-76ff4dd0de8d9747b9341f064dd270c5762705c6.tar.gz frameworks_base-76ff4dd0de8d9747b9341f064dd270c5762705c6.tar.bz2 |
AlertActivity now behaves as a dialog for accessibility purposes.
AlertActivity is intended to look like a dialog but for accessibility
purposes it was populated as an activity. As a result the content of
the "dialog" was not properly announced to the user.
bug:18865632
Change-Id: I27166fc74678981f4f3ad71d6d25727b5110340c
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/app/AlertActivity.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/com/android/internal/app/AlertActivity.java b/core/java/com/android/internal/app/AlertActivity.java index 7456def..5566aa6 100644 --- a/core/java/com/android/internal/app/AlertActivity.java +++ b/core/java/com/android/internal/app/AlertActivity.java @@ -17,9 +17,14 @@ package com.android.internal.app; import android.app.Activity; +import android.app.AlertDialog; +import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; +import android.text.TextUtils; import android.view.KeyEvent; +import android.view.ViewGroup; +import android.view.accessibility.AccessibilityEvent; /** * An activity that follows the visual style of an AlertDialog. @@ -62,6 +67,19 @@ public abstract class AlertActivity extends Activity implements DialogInterface } } + @Override + public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { + event.setClassName(Dialog.class.getName()); + event.setPackageName(getPackageName()); + + ViewGroup.LayoutParams params = getWindow().getAttributes(); + boolean isFullScreen = (params.width == ViewGroup.LayoutParams.MATCH_PARENT) && + (params.height == ViewGroup.LayoutParams.MATCH_PARENT); + event.setFullScreen(isFullScreen); + + return false; + } + /** * Sets up the alert, including applying the parameters to the alert model, * and installing the alert's content. |