|
18 | 18 | import android.util.Slog; |
19 | 19 | import android.util.SparseArray; |
20 | 20 | import android.util.SparseIntArray; |
| 21 | +import android.util.TimeUtils; |
21 | 22 | import android.view.Display; |
22 | 23 | import android.view.Surface; |
23 | 24 | import android.view.WindowManagerPolicy; |
24 | 25 | import android.view.animation.Animation; |
25 | 26 |
|
26 | 27 | import com.android.server.wm.WindowManagerService.AppWindowAnimParams; |
| 28 | +import com.android.server.wm.WindowManagerService.LayoutFields; |
27 | 29 | import com.android.server.wm.WindowManagerService.LayoutToAnimatorParams; |
28 | 30 |
|
29 | 31 | import java.io.PrintWriter; |
@@ -197,6 +199,15 @@ private void copyLayoutToAnimParamsLocked() { |
197 | 199 | mWallpaperTokens = new ArrayList<WindowToken>(layoutToAnim.mWallpaperTokens); |
198 | 200 | } |
199 | 201 |
|
| 202 | + if (WindowManagerService.DEBUG_WALLPAPER_LIGHT) { |
| 203 | + if (mWallpaperTarget != layoutToAnim.mWallpaperTarget |
| 204 | + || mLowerWallpaperTarget != layoutToAnim.mLowerWallpaperTarget |
| 205 | + || mUpperWallpaperTarget != layoutToAnim.mUpperWallpaperTarget) { |
| 206 | + Slog.d(TAG, "Updating anim wallpaper: target=" + mWallpaperTarget |
| 207 | + + " lower=" + mLowerWallpaperTarget + " upper=" |
| 208 | + + mUpperWallpaperTarget); |
| 209 | + } |
| 210 | + } |
200 | 211 | mWallpaperTarget = layoutToAnim.mWallpaperTarget; |
201 | 212 | mWpAppAnimator = mWallpaperTarget == null |
202 | 213 | ? null : mWallpaperTarget.mAppToken == null |
@@ -735,46 +746,144 @@ boolean isDimmingLocked(final WindowStateAnimator winAnimator) { |
735 | 746 | return dimParams != null && dimParams.mDimWinAnimator == winAnimator; |
736 | 747 | } |
737 | 748 |
|
| 749 | + static String bulkUpdateParamsToString(int bulkUpdateParams) { |
| 750 | + StringBuilder builder = new StringBuilder(128); |
| 751 | + if ((bulkUpdateParams & LayoutFields.SET_UPDATE_ROTATION) != 0) { |
| 752 | + builder.append(" UPDATE_ROTATION"); |
| 753 | + } |
| 754 | + if ((bulkUpdateParams & LayoutFields.SET_WALLPAPER_MAY_CHANGE) != 0) { |
| 755 | + builder.append(" WALLPAPER_MAY_CHANGE"); |
| 756 | + } |
| 757 | + if ((bulkUpdateParams & LayoutFields.SET_FORCE_HIDING_CHANGED) != 0) { |
| 758 | + builder.append(" FORCE_HIDING_CHANGED"); |
| 759 | + } |
| 760 | + if ((bulkUpdateParams & LayoutFields.SET_ORIENTATION_CHANGE_COMPLETE) != 0) { |
| 761 | + builder.append(" ORIENTATION_CHANGE_COMPLETE"); |
| 762 | + } |
| 763 | + if ((bulkUpdateParams & LayoutFields.SET_TURN_ON_SCREEN) != 0) { |
| 764 | + builder.append(" TURN_ON_SCREEN"); |
| 765 | + } |
| 766 | + return builder.toString(); |
| 767 | + } |
| 768 | + |
738 | 769 | public void dumpLocked(PrintWriter pw, String prefix, boolean dumpAll) { |
739 | | - if (dumpAll) { |
740 | | - if (mWindowDetachedWallpaper != null) { |
741 | | - pw.print(prefix); pw.print("mWindowDetachedWallpaper="); |
742 | | - pw.println(mWindowDetachedWallpaper); |
743 | | - } |
744 | | - pw.print(prefix); pw.print("mAnimTransactionSequence="); |
745 | | - pw.print(mAnimTransactionSequence); |
746 | | - pw.println(" mForceHiding=" + forceHidingToString()); |
747 | | - for (int i = 0; i < mDisplayContentsAnimators.size(); i++) { |
748 | | - pw.print(prefix); pw.print("DisplayContentsAnimator #"); |
749 | | - pw.println(mDisplayContentsAnimators.keyAt(i)); |
750 | | - DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i); |
751 | | - final String subPrefix = " " + prefix; |
752 | | - final String subSubPrefix = " " + subPrefix; |
753 | | - if (displayAnimator.mWindowAnimationBackgroundSurface != null) { |
754 | | - pw.println(subPrefix + "mWindowAnimationBackgroundSurface:"); |
755 | | - displayAnimator.mWindowAnimationBackgroundSurface.printTo(subSubPrefix, pw); |
756 | | - } |
757 | | - if (displayAnimator.mDimAnimator != null) { |
758 | | - pw.println(subPrefix + "mDimAnimator:"); |
759 | | - displayAnimator.mDimAnimator.printTo(subSubPrefix, pw); |
760 | | - } else { |
761 | | - pw.println(subPrefix + "no DimAnimator "); |
762 | | - } |
763 | | - if (displayAnimator.mDimParams != null) { |
764 | | - pw.println(subPrefix + "mDimParams:"); |
765 | | - displayAnimator.mDimParams.printTo(subSubPrefix, pw); |
| 770 | + final String subPrefix = " " + prefix; |
| 771 | + final String subSubPrefix = " " + subPrefix; |
| 772 | + |
| 773 | + boolean needSep = false; |
| 774 | + if (mAppAnimators.size() > 0) { |
| 775 | + needSep = true; |
| 776 | + pw.println(" App Animators:"); |
| 777 | + for (int i=mAppAnimators.size()-1; i>=0; i--) { |
| 778 | + AppWindowAnimator anim = mAppAnimators.get(i); |
| 779 | + pw.print(prefix); pw.print("App Animator #"); pw.print(i); |
| 780 | + pw.print(' '); pw.print(anim); |
| 781 | + if (dumpAll) { |
| 782 | + pw.println(':'); |
| 783 | + anim.dump(pw, subPrefix, dumpAll); |
766 | 784 | } else { |
767 | | - pw.println(subPrefix + "no DimParams "); |
| 785 | + pw.println(); |
768 | 786 | } |
769 | | - if (displayAnimator.mScreenRotationAnimation != null) { |
770 | | - pw.println(subPrefix + "mScreenRotationAnimation:"); |
771 | | - displayAnimator.mScreenRotationAnimation.printTo(subSubPrefix, pw); |
| 787 | + } |
| 788 | + } |
| 789 | + if (mWallpaperTokens.size() > 0) { |
| 790 | + if (needSep) { |
| 791 | + pw.println(); |
| 792 | + } |
| 793 | + needSep = true; |
| 794 | + pw.print(prefix); pw.println("Wallpaper tokens:"); |
| 795 | + for (int i=mWallpaperTokens.size()-1; i>=0; i--) { |
| 796 | + WindowToken token = mWallpaperTokens.get(i); |
| 797 | + pw.print(prefix); pw.print("Wallpaper #"); pw.print(i); |
| 798 | + pw.print(' '); pw.print(token); |
| 799 | + if (dumpAll) { |
| 800 | + pw.println(':'); |
| 801 | + token.dump(pw, subPrefix); |
772 | 802 | } else { |
773 | | - pw.print(subPrefix + "no ScreenRotationAnimation "); |
| 803 | + pw.println(); |
774 | 804 | } |
775 | 805 | } |
| 806 | + } |
| 807 | + |
| 808 | + if (needSep) { |
776 | 809 | pw.println(); |
777 | 810 | } |
| 811 | + for (int i = 0; i < mDisplayContentsAnimators.size(); i++) { |
| 812 | + pw.print(prefix); pw.print("DisplayContentsAnimator #"); |
| 813 | + pw.print(mDisplayContentsAnimators.keyAt(i)); |
| 814 | + pw.println(":"); |
| 815 | + DisplayContentsAnimator displayAnimator = mDisplayContentsAnimators.valueAt(i); |
| 816 | + for (int j=0; j<displayAnimator.mWinAnimators.size(); j++) { |
| 817 | + WindowStateAnimator wanim = displayAnimator.mWinAnimators.get(j); |
| 818 | + pw.print(subPrefix); pw.print("Window #"); pw.print(j); |
| 819 | + pw.print(": "); pw.println(wanim); |
| 820 | + } |
| 821 | + if (displayAnimator.mWindowAnimationBackgroundSurface != null) { |
| 822 | + if (dumpAll || displayAnimator.mWindowAnimationBackgroundSurface.mDimShown) { |
| 823 | + pw.print(subPrefix); pw.println("mWindowAnimationBackgroundSurface:"); |
| 824 | + displayAnimator.mWindowAnimationBackgroundSurface.printTo(subSubPrefix, pw); |
| 825 | + } |
| 826 | + } |
| 827 | + if (displayAnimator.mDimAnimator != null) { |
| 828 | + if (dumpAll || displayAnimator.mDimAnimator.mDimShown) { |
| 829 | + pw.print(subPrefix); pw.println("mDimAnimator:"); |
| 830 | + displayAnimator.mDimAnimator.printTo(subSubPrefix, pw); |
| 831 | + } |
| 832 | + } else if (dumpAll) { |
| 833 | + pw.print(subPrefix); pw.println("no DimAnimator "); |
| 834 | + } |
| 835 | + if (displayAnimator.mDimParams != null) { |
| 836 | + pw.print(subPrefix); pw.println("mDimParams:"); |
| 837 | + displayAnimator.mDimParams.printTo(subSubPrefix, pw); |
| 838 | + } else if (dumpAll) { |
| 839 | + pw.print(subPrefix); pw.println("no DimParams "); |
| 840 | + } |
| 841 | + if (displayAnimator.mScreenRotationAnimation != null) { |
| 842 | + pw.print(subPrefix); pw.println("mScreenRotationAnimation:"); |
| 843 | + displayAnimator.mScreenRotationAnimation.printTo(subSubPrefix, pw); |
| 844 | + } else if (dumpAll) { |
| 845 | + pw.print(subPrefix); pw.println("no ScreenRotationAnimation "); |
| 846 | + } |
| 847 | + } |
| 848 | + |
| 849 | + pw.println(); |
| 850 | + |
| 851 | + if (dumpAll) { |
| 852 | + pw.print(prefix); pw.print("mAnimTransactionSequence="); |
| 853 | + pw.print(mAnimTransactionSequence); |
| 854 | + pw.print(" mForceHiding="); pw.println(forceHidingToString()); |
| 855 | + pw.print(prefix); pw.print("mCurrentTime="); |
| 856 | + pw.println(TimeUtils.formatUptime(mCurrentTime)); |
| 857 | + pw.print(prefix); pw.print("mDw="); |
| 858 | + pw.print(mDw); pw.print(" mDh="); pw.print(mDh); |
| 859 | + pw.print(" mInnerDw="); pw.print(mInnerDw); |
| 860 | + pw.print(" mInnerDh="); pw.println(mInnerDh); |
| 861 | + } |
| 862 | + if (mBulkUpdateParams != 0) { |
| 863 | + pw.print(prefix); pw.print("mBulkUpdateParams=0x"); |
| 864 | + pw.print(Integer.toHexString(mBulkUpdateParams)); |
| 865 | + pw.println(bulkUpdateParamsToString(mBulkUpdateParams)); |
| 866 | + } |
| 867 | + if (mPendingActions != 0) { |
| 868 | + pw.print(prefix); pw.print("mPendingActions=0x"); |
| 869 | + pw.println(Integer.toHexString(mPendingActions)); |
| 870 | + } |
| 871 | + if (mWindowDetachedWallpaper != null) { |
| 872 | + pw.print(prefix); pw.print("mWindowDetachedWallpaper="); |
| 873 | + pw.println(mWindowDetachedWallpaper); |
| 874 | + } |
| 875 | + pw.print(prefix); pw.print("mWallpaperTarget="); pw.println(mWallpaperTarget); |
| 876 | + pw.print(prefix); pw.print("mWpAppAnimator="); pw.println(mWpAppAnimator); |
| 877 | + if (mLowerWallpaperTarget != null || mUpperWallpaperTarget != null) { |
| 878 | + pw.print(prefix); pw.print("mLowerWallpaperTarget="); |
| 879 | + pw.println(mLowerWallpaperTarget); |
| 880 | + pw.print(prefix); pw.print("mUpperWallpaperTarget="); |
| 881 | + pw.println(mUpperWallpaperTarget); |
| 882 | + } |
| 883 | + if (mUniverseBackground != null) { |
| 884 | + pw.print(prefix); pw.print("mUniverseBackground="); pw.print(mUniverseBackground); |
| 885 | + pw.print(" mAboveUniverseLayer="); pw.println(mAboveUniverseLayer); |
| 886 | + } |
778 | 887 | } |
779 | 888 |
|
780 | 889 | void clearPendingActions() { |
|
0 commit comments