diff options
-rw-r--r-- | services/java/com/android/server/display/WifiDisplayAdapter.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/services/java/com/android/server/display/WifiDisplayAdapter.java b/services/java/com/android/server/display/WifiDisplayAdapter.java index 3e541dd..c441b02 100644 --- a/services/java/com/android/server/display/WifiDisplayAdapter.java +++ b/services/java/com/android/server/display/WifiDisplayAdapter.java @@ -198,6 +198,12 @@ final class WifiDisplayAdapter extends DisplayAdapter { updateRememberedDisplaysLocked(); scheduleStatusChangedBroadcastLocked(); } + + if (mActiveDisplay != null && mActiveDisplay.getDeviceAddress().equals(address) + && mDisplayDevice != null) { + mDisplayDevice.setNameLocked(mActiveDisplay.getFriendlyDisplayName()); + sendDisplayDeviceEventLocked(mDisplayDevice, DISPLAY_DEVICE_EVENT_CHANGED); + } } public void requestForgetLocked(String address) { @@ -397,7 +403,7 @@ final class WifiDisplayAdapter extends DisplayAdapter { }; private final class WifiDisplayDevice extends DisplayDevice { - private final String mName; + private String mName; private final int mWidth; private final int mHeight; private final float mRefreshRate; @@ -423,6 +429,11 @@ final class WifiDisplayAdapter extends DisplayAdapter { sendTraversalRequestLocked(); } + public void setNameLocked(String name) { + mName = name; + mInfo = null; + } + @Override public void performTraversalInTransactionLocked() { setSurfaceInTransactionLocked(mSurface); |