summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/display/WifiDisplayAdapter.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-10-15 15:31:59 -0700
committerJeff Brown <jeffbrown@google.com>2012-10-15 15:31:59 -0700
commitee4f029ff4905abbdbc1ce47db2cf2c3510949e9 (patch)
tree1b195a60bd34e1eeaa4fef7396712d82800b683c /services/java/com/android/server/display/WifiDisplayAdapter.java
parenta30d969401a8533a5a341664421ba9b1e150bac3 (diff)
downloadframeworks_base-ee4f029ff4905abbdbc1ce47db2cf2c3510949e9.zip
frameworks_base-ee4f029ff4905abbdbc1ce47db2cf2c3510949e9.tar.gz
frameworks_base-ee4f029ff4905abbdbc1ce47db2cf2c3510949e9.tar.bz2
Update wifi display device name when renamed.
Bug: 7340725 Change-Id: Ia3835a37fa3800371920f863b82f992efe764664
Diffstat (limited to 'services/java/com/android/server/display/WifiDisplayAdapter.java')
-rw-r--r--services/java/com/android/server/display/WifiDisplayAdapter.java13
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);