Debian Codegraph @

core/java/android/view/PointerIcon.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package android.view;
18
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.annotation.XmlRes;
22 import android.compat.annotation.UnsupportedAppUsage;
23 import android.content.Context;
24 import android.content.res.Resources;
25 import android.content.res.TypedArray;
26 import android.content.res.XmlResourceParser;
27 import android.graphics.Bitmap;
28 import android.graphics.Canvas;
29 import android.graphics.Paint;
30 import android.graphics.Rect;
31 import android.graphics.RectF;
32 import android.graphics.drawable.AnimationDrawable;
33 import android.graphics.drawable.BitmapDrawable;
34 import android.graphics.drawable.Drawable;
35 import android.hardware.display.DisplayManager;
36 import android.os.Build;
37 import android.os.Parcel;
38 import android.os.Parcelable;
39 import android.util.Log;
40 import android.util.SparseArray;
41
42 import com.android.internal.util.XmlUtils;
43
44 /**
45 * Represents an icon that can be used as a mouse pointer.
46 * <p>
47 * Pointer icons can be provided either by the system using system types,
48 * or by applications using bitmaps or application resources.
49 * </p>
50 */
51 public final class PointerIcon implements Parcelable {
52 private static final String TAG = "PointerIcon";
53
54 /** {@hide} Type constant: Custom icon with a user-supplied bitmap. */
55 public static final int TYPE_CUSTOM = -1;
56
57 /** Type constant: Null icon. It has no bitmap. */
58 public static final int TYPE_NULL = 0;
59
60 /** Type constant: no icons are specified. If all views uses this, then falls back
61 * to the default type, but this is helpful to distinguish a view explicitly want
62 * to have the default icon.
63 * @hide
64 */
65 public static final int TYPE_NOT_SPECIFIED = 1;
66
67 /** Type constant: Arrow icon. (Default mouse pointer) */
68 public static final int TYPE_ARROW = 1000;
69
70 /** {@hide} Type constant: Spot hover icon for touchpads. */
71 public static final int TYPE_SPOT_HOVER = 2000;
72
73 /** {@hide} Type constant: Spot touch icon for touchpads. */
74 public static final int TYPE_SPOT_TOUCH = 2001;
75
76 /** {@hide} Type constant: Spot anchor icon for touchpads. */
77 public static final int TYPE_SPOT_ANCHOR = 2002;
78
79 // Type constants for additional predefined icons for mice.
80 /** Type constant: context-menu. */
81 public static final int TYPE_CONTEXT_MENU = 1001;
82
83 /** Type constant: hand. */
84 public static final int TYPE_HAND = 1002;
85
86 /** Type constant: help. */
87 public static final int TYPE_HELP = 1003;
88
89 /** Type constant: wait. */
90 public static final int TYPE_WAIT = 1004;
91
92 /** Type constant: cell. */
93 public static final int TYPE_CELL = 1006;
94
95 /** Type constant: crosshair. */
96 public static final int TYPE_CROSSHAIR = 1007;
97
98 /** Type constant: text. */
99 public static final int TYPE_TEXT = 1008;
100
101 /** Type constant: vertical-text. */
102 public static final int TYPE_VERTICAL_TEXT = 1009;
103
104 /** Type constant: alias (indicating an alias of/shortcut to something is
105 * to be created. */
106 public static final int TYPE_ALIAS = 1010;
107
108 /** Type constant: copy. */
109 public static final int TYPE_COPY = 1011;
110
111 /** Type constant: no-drop. */
112 public static final int TYPE_NO_DROP = 1012;
113
114 /** Type constant: all-scroll. */
115 public static final int TYPE_ALL_SCROLL = 1013;
116
117 /** Type constant: horizontal double arrow mainly for resizing. */
118 public static final int TYPE_HORIZONTAL_DOUBLE_ARROW = 1014;
119
120 /** Type constant: vertical double arrow mainly for resizing. */
121 public static final int TYPE_VERTICAL_DOUBLE_ARROW = 1015;
122
123 /** Type constant: diagonal double arrow -- top-right to bottom-left. */
124 public static final int TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW = 1016;
125
126 /** Type constant: diagonal double arrow -- top-left to bottom-right. */
127 public static final int TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW = 1017;
128
129 /** Type constant: zoom-in. */
130 public static final int TYPE_ZOOM_IN = 1018;
131
132 /** Type constant: zoom-out. */
133 public static final int TYPE_ZOOM_OUT = 1019;
134
135 /** Type constant: grab. */
136 public static final int TYPE_GRAB = 1020;
137
138 /** Type constant: grabbing. */
139 public static final int TYPE_GRABBING = 1021;
140
141 // OEM private types should be defined starting at this range to avoid
142 // conflicts with any system types that may be defined in the future.
143 private static final int TYPE_OEM_FIRST = 10000;
144
145 /** The default pointer icon. */
146 public static final int TYPE_DEFAULT = TYPE_ARROW;
147
148 private static final PointerIcon gNullIcon = new PointerIcon(TYPE_NULL);
149 private static final SparseArray<SparseArray<PointerIcon>> gSystemIconsByDisplay =
150 new SparseArray<SparseArray<PointerIcon>>();
151 private static boolean sUseLargeIcons = false;
152
153 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
154 private final int mType;
155 private int mSystemIconResourceId;
156 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
157 private Bitmap mBitmap;
158 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
159 private float mHotSpotX;
160 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
161 private float mHotSpotY;
162 // The bitmaps for the additional frame of animated pointer icon. Note that the first frame
163 // will be stored in mBitmap.
164 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
165 private Bitmap mBitmapFrames[];
166 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
167 private int mDurationPerFrame;
168
169 /**
170 * Listener for displays lifecycle.
171 * @hide
172 */
173 private static DisplayManager.DisplayListener sDisplayListener;
174
175 private PointerIcon(int type) {
176 mType = type;
177 }
178
179 /**
180 * Gets a special pointer icon that has no bitmap.
181 *
182 * @return The null pointer icon.
183 *
184 * @see #TYPE_NULL
185 * @hide
186 */
187 public static @NonNull PointerIcon getNullIcon() {
188 return gNullIcon;
189 }
190
191 /**
192 * Gets the default pointer icon.
193 *
194 * @param context The context.
195 * @return The default pointer icon.
196 *
197 * @throws IllegalArgumentException if context is null.
198 * @hide
199 */
200 public static @NonNull PointerIcon getDefaultIcon(@NonNull Context context) {
201 return getSystemIcon(context, TYPE_DEFAULT);
202 }
203
204 /**
205 * Gets a system pointer icon for the given type.
206 * If typeis not recognized, returns the default pointer icon.
207 *
208 * @param context The context.
209 * @param type The pointer icon type.
210 * @return The pointer icon.
211 *
212 * @throws IllegalArgumentException if context is null.
213 */
214 public static @NonNull PointerIcon getSystemIcon(@NonNull Context context, int type) {
215 if (context == null) {
216 throw new IllegalArgumentException("context must not be null");
217 }
218
219 if (type == TYPE_NULL) {
220 return gNullIcon;
221 }
222
223 if (sDisplayListener == null) {
224 registerDisplayListener(context);
225 }
226
227 final int displayId = context.getDisplayId();
228 SparseArray<PointerIcon> systemIcons = gSystemIconsByDisplay.get(displayId);
229 if (systemIcons == null) {
230 systemIcons = new SparseArray<>();
231 gSystemIconsByDisplay.put(displayId, systemIcons);
232 }
233
234 PointerIcon icon = systemIcons.get(type);
235 // Reload if not in the same display.
236 if (icon != null) {
237 return icon;
238 }
239
240 int typeIndex = getSystemIconTypeIndex(type);
241 if (typeIndex == 0) {
242 typeIndex = getSystemIconTypeIndex(TYPE_DEFAULT);
243 }
244
245 int defStyle = sUseLargeIcons ?
246 com.android.internal.R.style.LargePointer : com.android.internal.R.style.Pointer;
247 TypedArray a = context.obtainStyledAttributes(null,
248 com.android.internal.R.styleable.Pointer,
249 0, defStyle);
250 int resourceId = a.getResourceId(typeIndex, -1);
251 a.recycle();
252
253 if (resourceId == -1) {
254 Log.w(TAG, "Missing theme resources for pointer icon type " + type);
255 return type == TYPE_DEFAULT ? gNullIcon : getSystemIcon(context, TYPE_DEFAULT);
256 }
257
258 icon = new PointerIcon(type);
259 if ((resourceId & 0xff000000) == 0x01000000) {
260 icon.mSystemIconResourceId = resourceId;
261 } else {
262 icon.loadResource(context, context.getResources(), resourceId);
263 }
264 systemIcons.append(type, icon);
265 return icon;
266 }
267
268 /**
269 * Updates wheter accessibility large icons are used or not.
270 * @hide
271 */
272 public static void setUseLargeIcons(boolean use) {
273 sUseLargeIcons = use;
274 gSystemIconsByDisplay.clear();
275 }
276
277 /**
278 * Creates a custom pointer icon from the given bitmap and hotspot information.
279 *
280 * @param bitmap The bitmap for the icon.
281 * @param hotSpotX The X offset of the pointer icon hotspot in the bitmap.
282 * Must be within the [0, bitmap.getWidth()) range.
283 * @param hotSpotY The Y offset of the pointer icon hotspot in the bitmap.
284 * Must be within the [0, bitmap.getHeight()) range.
285 * @return A pointer icon for this bitmap.
286 *
287 * @throws IllegalArgumentException if bitmap is null, or if the x/y hotspot
288 * parameters are invalid.
289 */
290 public static @NonNull PointerIcon create(@NonNull Bitmap bitmap, float hotSpotX,
291 float hotSpotY) {
292 if (bitmap == null) {
293 throw new IllegalArgumentException("bitmap must not be null");
294 }
295 validateHotSpot(bitmap, hotSpotX, hotSpotY);
296
297 PointerIcon icon = new PointerIcon(TYPE_CUSTOM);
298 icon.mBitmap = bitmap;
299 icon.mHotSpotX = hotSpotX;
300 icon.mHotSpotY = hotSpotY;
301 return icon;
302 }
303
304 /**
305 * Loads a custom pointer icon from an XML resource.
306 * <p>
307 * The XML resource should have the following form:
308 * <code>
309 * &lt;?xml version="1.0" encoding="utf-8"?&gt;
310 * &lt;pointer-icon xmlns:android="http://schemas.android.com/apk/res/android"
311 * android:bitmap="@drawable/my_pointer_bitmap"
312 * android:hotSpotX="24"
313 * android:hotSpotY="24" /&gt;
314 * </code>
315 * </p>
316 *
317 * @param resources The resources object.
318 * @param resourceId The resource id.
319 * @return The pointer icon.
320 *
321 * @throws IllegalArgumentException if resources is null.
322 * @throws Resources.NotFoundException if the resource was not found or the drawable
323 * linked in the resource was not found.
324 */
325 public static @NonNull PointerIcon load(@NonNull Resources resources, @XmlRes int resourceId) {
326 if (resources == null) {
327 throw new IllegalArgumentException("resources must not be null");
328 }
329
330 PointerIcon icon = new PointerIcon(TYPE_CUSTOM);
331 icon.loadResource(null, resources, resourceId);
332 return icon;
333 }
334
335 /**
336 * Loads the bitmap and hotspot information for a pointer icon, if it is not already loaded.
337 * Returns a pointer icon (not necessarily the same instance) with the information filled in.
338 *
339 * @param context The context.
340 * @return The loaded pointer icon.
341 *
342 * @throws IllegalArgumentException if context is null.
343 * @hide
344 */
345 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
346 public @NonNull PointerIcon load(@NonNull Context context) {
347 if (context == null) {
348 throw new IllegalArgumentException("context must not be null");
349 }
350
351 if (mSystemIconResourceId == 0 || mBitmap != null) {
352 return this;
353 }
354
355 PointerIcon result = new PointerIcon(mType);
356 result.mSystemIconResourceId = mSystemIconResourceId;
357 result.loadResource(context, context.getResources(), mSystemIconResourceId);
358 return result;
359 }
360
361 /** @hide */
362 public int getType() {
363 return mType;
364 }
365
366 public static final @NonNull Parcelable.Creator<PointerIcon> CREATOR
367 = new Parcelable.Creator<PointerIcon>() {
368 public PointerIcon createFromParcel(Parcel in) {
369 int type = in.readInt();
370 if (type == TYPE_NULL) {
371 return getNullIcon();
372 }
373
374 int systemIconResourceId = in.readInt();
375 if (systemIconResourceId != 0) {
376 PointerIcon icon = new PointerIcon(type);
377 icon.mSystemIconResourceId = systemIconResourceId;
378 return icon;
379 }
380
381 Bitmap bitmap = Bitmap.CREATOR.createFromParcel(in);
382 float hotSpotX = in.readFloat();
383 float hotSpotY = in.readFloat();
384 return PointerIcon.create(bitmap, hotSpotX, hotSpotY);
385 }
386
387 public PointerIcon[] newArray(int size) {
388 return new PointerIcon[size];
389 }
390 };
391
392 public int describeContents() {
393 return 0;
394 }
395
396 public void writeToParcel(Parcel out, int flags) {
397 out.writeInt(mType);
398
399 if (mType != TYPE_NULL) {
400 out.writeInt(mSystemIconResourceId);
401 if (mSystemIconResourceId == 0) {
402 mBitmap.writeToParcel(out, flags);
403 out.writeFloat(mHotSpotX);
404 out.writeFloat(mHotSpotY);
405 }
406 }
407 }
408
409 @Override
410 public boolean equals(@Nullable Object other) {
411 if (this == other) {
412 return true;
413 }
414
415 if (other == null || !(other instanceof PointerIcon)) {
416 return false;
417 }
418
419 PointerIcon otherIcon = (PointerIcon) other;
420 if (mType != otherIcon.mType
421 || mSystemIconResourceId != otherIcon.mSystemIconResourceId) {
422 return false;
423 }
424
425 if (mSystemIconResourceId == 0 && (mBitmap != otherIcon.mBitmap
426 || mHotSpotX != otherIcon.mHotSpotX
427 || mHotSpotY != otherIcon.mHotSpotY)) {
428 return false;
429 }
430
431 return true;
432 }
433
434 /**
435 * Get the Bitmap from the Drawable.
436 *
437 * If the Bitmap needed to be scaled up to account for density, BitmapDrawable
438 * handles this at draw time. But this class doesn't actually draw the Bitmap;
439 * it is just a holder for native code to access its SkBitmap. So this needs to
440 * get a version that is scaled to account for density.
441 */
442 private Bitmap getBitmapFromDrawable(BitmapDrawable bitmapDrawable) {
443 Bitmap bitmap = bitmapDrawable.getBitmap();
444 final int scaledWidth = bitmapDrawable.getIntrinsicWidth();
445 final int scaledHeight = bitmapDrawable.getIntrinsicHeight();
446 if (scaledWidth == bitmap.getWidth() && scaledHeight == bitmap.getHeight()) {
447 return bitmap;
448 }
449
450 Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
451 RectF dst = new RectF(0, 0, scaledWidth, scaledHeight);
452
453 Bitmap scaled = Bitmap.createBitmap(scaledWidth, scaledHeight, bitmap.getConfig());
454 Canvas canvas = new Canvas(scaled);
455 Paint paint = new Paint();
456 paint.setFilterBitmap(true);
457 canvas.drawBitmap(bitmap, src, dst, paint);
458 return scaled;
459 }
460
461 private void loadResource(Context context, Resources resources, @XmlRes int resourceId) {
462 final XmlResourceParser parser = resources.getXml(resourceId);
463 final int bitmapRes;
464 final float hotSpotX;
465 final float hotSpotY;
466 try {
467 XmlUtils.beginDocument(parser, "pointer-icon");
468
469 final TypedArray a = resources.obtainAttributes(
470 parser, com.android.internal.R.styleable.PointerIcon);
471 bitmapRes = a.getResourceId(com.android.internal.R.styleable.PointerIcon_bitmap, 0);
472 hotSpotX = a.getDimension(com.android.internal.R.styleable.PointerIcon_hotSpotX, 0);
473 hotSpotY = a.getDimension(com.android.internal.R.styleable.PointerIcon_hotSpotY, 0);
474 a.recycle();
475 } catch (Exception ex) {
476 throw new IllegalArgumentException("Exception parsing pointer icon resource.", ex);
477 } finally {
478 parser.close();
479 }
480
481 if (bitmapRes == 0) {
482 throw new IllegalArgumentException("<pointer-icon> is missing bitmap attribute.");
483 }
484
485 Drawable drawable;
486 if (context == null) {
487 drawable = resources.getDrawable(bitmapRes);
488 } else {
489 drawable = context.getDrawable(bitmapRes);
490 }
491 if (drawable instanceof AnimationDrawable) {
492 // Extract animation frame bitmaps.
493 final AnimationDrawable animationDrawable = (AnimationDrawable) drawable;
494 final int frames = animationDrawable.getNumberOfFrames();
495 drawable = animationDrawable.getFrame(0);
496 if (frames == 1) {
497 Log.w(TAG, "Animation icon with single frame -- simply treating the first "
498 + "frame as a normal bitmap icon.");
499 } else {
500 // Assumes they have the exact duration.
501 mDurationPerFrame = animationDrawable.getDuration(0);
502 mBitmapFrames = new Bitmap[frames - 1];
503 final int width = drawable.getIntrinsicWidth();
504 final int height = drawable.getIntrinsicHeight();
505 for (int i = 1; i < frames; ++i) {
506 Drawable drawableFrame = animationDrawable.getFrame(i);
507 if (!(drawableFrame instanceof BitmapDrawable)) {
508 throw new IllegalArgumentException("Frame of an animated pointer icon "
509 + "must refer to a bitmap drawable.");
510 }
511 if (drawableFrame.getIntrinsicWidth() != width ||
512 drawableFrame.getIntrinsicHeight() != height) {
513 throw new IllegalArgumentException("The bitmap size of " + i + "-th frame "
514 + "is different. All frames should have the exact same size and "
515 + "share the same hotspot.");
516 }
517 BitmapDrawable bitmapDrawableFrame = (BitmapDrawable) drawableFrame;
518 mBitmapFrames[i - 1] = getBitmapFromDrawable(bitmapDrawableFrame);
519 }
520 }
521 }
522 if (!(drawable instanceof BitmapDrawable)) {
523 throw new IllegalArgumentException("<pointer-icon> bitmap attribute must "
524 + "refer to a bitmap drawable.");
525 }
526
527 BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
528 final Bitmap bitmap = getBitmapFromDrawable(bitmapDrawable);
529 validateHotSpot(bitmap, hotSpotX, hotSpotY);
530 // Set the properties now that we have successfully loaded the icon.
531 mBitmap = bitmap;
532 mHotSpotX = hotSpotX;
533 mHotSpotY = hotSpotY;
534 }
535
536 private static void validateHotSpot(Bitmap bitmap, float hotSpotX, float hotSpotY) {
537 if (hotSpotX < 0 || hotSpotX >= bitmap.getWidth()) {
538 throw new IllegalArgumentException("x hotspot lies outside of the bitmap area");
539 }
540 if (hotSpotY < 0 || hotSpotY >= bitmap.getHeight()) {
541 throw new IllegalArgumentException("y hotspot lies outside of the bitmap area");
542 }
543 }
544
545 private static int getSystemIconTypeIndex(int type) {
546 switch (type) {
547 case TYPE_ARROW:
548 return com.android.internal.R.styleable.Pointer_pointerIconArrow;
549 case TYPE_SPOT_HOVER:
550 return com.android.internal.R.styleable.Pointer_pointerIconSpotHover;
551 case TYPE_SPOT_TOUCH:
552 return com.android.internal.R.styleable.Pointer_pointerIconSpotTouch;
553 case TYPE_SPOT_ANCHOR:
554 return com.android.internal.R.styleable.Pointer_pointerIconSpotAnchor;
555 case TYPE_HAND:
556 return com.android.internal.R.styleable.Pointer_pointerIconHand;
557 case TYPE_CONTEXT_MENU:
558 return com.android.internal.R.styleable.Pointer_pointerIconContextMenu;
559 case TYPE_HELP:
560 return com.android.internal.R.styleable.Pointer_pointerIconHelp;
561 case TYPE_WAIT:
562 return com.android.internal.R.styleable.Pointer_pointerIconWait;
563 case TYPE_CELL:
564 return com.android.internal.R.styleable.Pointer_pointerIconCell;
565 case TYPE_CROSSHAIR:
566 return com.android.internal.R.styleable.Pointer_pointerIconCrosshair;
567 case TYPE_TEXT:
568 return com.android.internal.R.styleable.Pointer_pointerIconText;
569 case TYPE_VERTICAL_TEXT:
570 return com.android.internal.R.styleable.Pointer_pointerIconVerticalText;
571 case TYPE_ALIAS:
572 return com.android.internal.R.styleable.Pointer_pointerIconAlias;
573 case TYPE_COPY:
574 return com.android.internal.R.styleable.Pointer_pointerIconCopy;
575 case TYPE_ALL_SCROLL:
576 return com.android.internal.R.styleable.Pointer_pointerIconAllScroll;
577 case TYPE_NO_DROP:
578 return com.android.internal.R.styleable.Pointer_pointerIconNodrop;
579 case TYPE_HORIZONTAL_DOUBLE_ARROW:
580 return com.android.internal.R.styleable.Pointer_pointerIconHorizontalDoubleArrow;
581 case TYPE_VERTICAL_DOUBLE_ARROW:
582 return com.android.internal.R.styleable.Pointer_pointerIconVerticalDoubleArrow;
583 case TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW:
584 return com.android.internal.R.styleable.
585 Pointer_pointerIconTopRightDiagonalDoubleArrow;
586 case TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW:
587 return com.android.internal.R.styleable.
588 Pointer_pointerIconTopLeftDiagonalDoubleArrow;
589 case TYPE_ZOOM_IN:
590 return com.android.internal.R.styleable.Pointer_pointerIconZoomIn;
591 case TYPE_ZOOM_OUT:
592 return com.android.internal.R.styleable.Pointer_pointerIconZoomOut;
593 case TYPE_GRAB:
594 return com.android.internal.R.styleable.Pointer_pointerIconGrab;
595 case TYPE_GRABBING:
596 return com.android.internal.R.styleable.Pointer_pointerIconGrabbing;
597 default:
598 return 0;
599 }
600 }
601
602 /**
603 * Manage system icon cache handled by display lifecycle.
604 * @param context The context.
605 */
606 private static void registerDisplayListener(@NonNull Context context) {
607 sDisplayListener = new DisplayManager.DisplayListener() {
608 @Override
609 public void onDisplayAdded(int displayId) {
610 }
611
612 @Override
613 public void onDisplayRemoved(int displayId) {
614 gSystemIconsByDisplay.remove(displayId);
615 }
616
617 @Override
618 public void onDisplayChanged(int displayId) {
619 gSystemIconsByDisplay.remove(displayId);
620 }
621 };
622
623 DisplayManager displayManager = context.getSystemService(DisplayManager.class);
624 displayManager.registerDisplayListener(sDisplayListener, null /* handler */);
625 }
626
627 }