Loading core/java/android/view/View.java +8 −7 Original line number Diff line number Diff line Loading @@ -18055,19 +18055,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * currently attached to. */ public WindowId getWindowId() { if (mAttachInfo == null) { AttachInfo ai = mAttachInfo; if (ai == null) { return null; } if (mAttachInfo.mWindowId == null) { if (ai.mWindowId == null) { try { mAttachInfo.mIWindowId = mAttachInfo.mSession.getWindowId( mAttachInfo.mWindowToken); mAttachInfo.mWindowId = new WindowId( mAttachInfo.mIWindowId); ai.mIWindowId = ai.mSession.getWindowId(ai.mWindowToken); if (ai.mIWindowId != null) { ai.mWindowId = new WindowId(ai.mIWindowId); } } catch (RemoteException e) { } } return mAttachInfo.mWindowId; return ai.mWindowId; } /** core/java/android/view/WindowId.java +13 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.view; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Handler; import android.os.IBinder; import android.os.Message; Loading @@ -35,6 +37,7 @@ import java.util.HashMap; * that doesn't allow the other process to negatively harm your window. */ public class WindowId implements Parcelable { @NonNull private final IWindowId mToken; /** Loading Loading @@ -74,8 +77,7 @@ public class WindowId implements Parcelable { } }; final HashMap<IBinder, WindowId> mRegistrations = new HashMap<IBinder, WindowId>(); final HashMap<IBinder, WindowId> mRegistrations = new HashMap<>(); class H extends Handler { @Override Loading Loading @@ -163,10 +165,9 @@ public class WindowId implements Parcelable { * same package. */ @Override public boolean equals(Object otherObj) { public boolean equals(@Nullable Object otherObj) { if (otherObj instanceof WindowId) { return mToken.asBinder().equals(((WindowId) otherObj) .mToken.asBinder()); return mToken.asBinder().equals(((WindowId) otherObj).mToken.asBinder()); } return false; } Loading @@ -182,7 +183,7 @@ public class WindowId implements Parcelable { sb.append("IntentSender{"); sb.append(Integer.toHexString(System.identityHashCode(this))); sb.append(": "); sb.append(mToken != null ? mToken.asBinder() : null); sb.append(mToken.asBinder()); sb.append('}'); return sb.toString(); } Loading @@ -195,30 +196,32 @@ public class WindowId implements Parcelable { out.writeStrongBinder(mToken.asBinder()); } public static final Parcelable.Creator<WindowId> CREATOR = new Parcelable.Creator<WindowId>() { public static final Parcelable.Creator<WindowId> CREATOR = new Parcelable.Creator<WindowId>() { @Override public WindowId createFromParcel(Parcel in) { IBinder target = in.readStrongBinder(); return target != null ? new WindowId(target) : null; } @Override public WindowId[] newArray(int size) { return new WindowId[size]; } }; /** @hide */ @NonNull public IWindowId getTarget() { return mToken; } /** @hide */ public WindowId(IWindowId target) { public WindowId(@NonNull IWindowId target) { mToken = target; } /** @hide */ public WindowId(IBinder target) { public WindowId(@NonNull IBinder target) { mToken = IWindowId.Stub.asInterface(target); } } core/java/android/widget/PopupWindow.java +3 −1 Original line number Diff line number Diff line Loading @@ -2563,8 +2563,10 @@ public class PopupWindow { public void onViewDetachedFromWindow(View v) { v.removeOnAttachStateChangeListener(this); if (isAttachedToWindow()) { TransitionManager.endTransitions(PopupDecorView.this); } } }; @Override Loading Loading
core/java/android/view/View.java +8 −7 Original line number Diff line number Diff line Loading @@ -18055,19 +18055,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * currently attached to. */ public WindowId getWindowId() { if (mAttachInfo == null) { AttachInfo ai = mAttachInfo; if (ai == null) { return null; } if (mAttachInfo.mWindowId == null) { if (ai.mWindowId == null) { try { mAttachInfo.mIWindowId = mAttachInfo.mSession.getWindowId( mAttachInfo.mWindowToken); mAttachInfo.mWindowId = new WindowId( mAttachInfo.mIWindowId); ai.mIWindowId = ai.mSession.getWindowId(ai.mWindowToken); if (ai.mIWindowId != null) { ai.mWindowId = new WindowId(ai.mIWindowId); } } catch (RemoteException e) { } } return mAttachInfo.mWindowId; return ai.mWindowId; } /**
core/java/android/view/WindowId.java +13 −10 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.view; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Handler; import android.os.IBinder; import android.os.Message; Loading @@ -35,6 +37,7 @@ import java.util.HashMap; * that doesn't allow the other process to negatively harm your window. */ public class WindowId implements Parcelable { @NonNull private final IWindowId mToken; /** Loading Loading @@ -74,8 +77,7 @@ public class WindowId implements Parcelable { } }; final HashMap<IBinder, WindowId> mRegistrations = new HashMap<IBinder, WindowId>(); final HashMap<IBinder, WindowId> mRegistrations = new HashMap<>(); class H extends Handler { @Override Loading Loading @@ -163,10 +165,9 @@ public class WindowId implements Parcelable { * same package. */ @Override public boolean equals(Object otherObj) { public boolean equals(@Nullable Object otherObj) { if (otherObj instanceof WindowId) { return mToken.asBinder().equals(((WindowId) otherObj) .mToken.asBinder()); return mToken.asBinder().equals(((WindowId) otherObj).mToken.asBinder()); } return false; } Loading @@ -182,7 +183,7 @@ public class WindowId implements Parcelable { sb.append("IntentSender{"); sb.append(Integer.toHexString(System.identityHashCode(this))); sb.append(": "); sb.append(mToken != null ? mToken.asBinder() : null); sb.append(mToken.asBinder()); sb.append('}'); return sb.toString(); } Loading @@ -195,30 +196,32 @@ public class WindowId implements Parcelable { out.writeStrongBinder(mToken.asBinder()); } public static final Parcelable.Creator<WindowId> CREATOR = new Parcelable.Creator<WindowId>() { public static final Parcelable.Creator<WindowId> CREATOR = new Parcelable.Creator<WindowId>() { @Override public WindowId createFromParcel(Parcel in) { IBinder target = in.readStrongBinder(); return target != null ? new WindowId(target) : null; } @Override public WindowId[] newArray(int size) { return new WindowId[size]; } }; /** @hide */ @NonNull public IWindowId getTarget() { return mToken; } /** @hide */ public WindowId(IWindowId target) { public WindowId(@NonNull IWindowId target) { mToken = target; } /** @hide */ public WindowId(IBinder target) { public WindowId(@NonNull IBinder target) { mToken = IWindowId.Stub.asInterface(target); } }
core/java/android/widget/PopupWindow.java +3 −1 Original line number Diff line number Diff line Loading @@ -2563,8 +2563,10 @@ public class PopupWindow { public void onViewDetachedFromWindow(View v) { v.removeOnAttachStateChangeListener(this); if (isAttachedToWindow()) { TransitionManager.endTransitions(PopupDecorView.this); } } }; @Override Loading