Merge \\\"Revert \\\"Improve accessibility window title behavior\\\"\\\" into nyc-dev am: fc71309640 am: 2c8099110e

am: d06094dd86

Change-Id: I9da39b5bbd28592f7babe17f3aff4142e04f2e47
This commit is contained in:
Phil Weaver
2016-06-08 02:31:16 +00:00
committed by android-build-merger
4 changed files with 10 additions and 21 deletions

View File

@@ -16,7 +16,6 @@
package android.view.accessibility;
import android.annotation.Nullable;
import android.graphics.Rect;
import android.os.Parcel;
import android.os.Parcelable;
@@ -102,9 +101,8 @@ public final class AccessibilityWindowInfo implements Parcelable {
/**
* Gets the title of the window.
*
* @return The title of the window, or {@code null} if none is available.
* @return The title.
*/
@Nullable
public CharSequence getTitle() {
return mTitle;
}

View File

@@ -528,22 +528,16 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
@Override
public void setTitle(CharSequence title) {
setTitle(title, true);
}
public void setTitle(CharSequence title, boolean updateAccessibilityTitle) {
if (mTitleView != null) {
mTitleView.setText(title);
} else if (mDecorContentParent != null) {
mDecorContentParent.setWindowTitle(title);
}
mTitle = title;
if (updateAccessibilityTitle) {
WindowManager.LayoutParams params = getAttributes();
if (!TextUtils.equals(title, params.accessibilityTitle)) {
params.accessibilityTitle = TextUtils.stringOrSpannedString(title);
dispatchWindowAttributesChanged(getAttributes());
}
WindowManager.LayoutParams params = getAttributes();
if (!TextUtils.equals(title, params.accessibilityTitle)) {
params.accessibilityTitle = TextUtils.stringOrSpannedString(title);
dispatchWindowAttributesChanged(getAttributes());
}
}