Loading services/java/com/android/server/display/WifiDisplayController.java +15 −6 Original line number Diff line number Diff line Loading @@ -129,6 +129,9 @@ final class WifiDisplayController implements DumpUtils.Dump { // True if RTSP has connected. private boolean mRemoteDisplayConnected; // True if the remote submix is enabled. private boolean mRemoteSubmixOn; public WifiDisplayController(Context context, Handler handler, Listener listener) { mContext = context; mHandler = handler; Loading Loading @@ -160,6 +163,7 @@ final class WifiDisplayController implements DumpUtils.Dump { pw.println("mRemoteDisplay=" + mRemoteDisplay); pw.println("mRemoteDisplayInterface=" + mRemoteDisplayInterface); pw.println("mRemoteDisplayConnected=" + mRemoteDisplayConnected); pw.println("mRemoteSubmixOn=" + mRemoteSubmixOn); pw.println("mKnownWifiDisplayPeers: size=" + mKnownWifiDisplayPeers.size()); for (WifiP2pDevice device : mKnownWifiDisplayPeers) { Loading Loading @@ -390,16 +394,14 @@ final class WifiDisplayController implements DumpUtils.Dump { Slog.i(TAG, "Stopped listening for RTSP connection on " + mRemoteDisplayInterface + " from Wifi display: " + mConnectedDevice.deviceName); if (mRemoteDisplayConnected) { mAudioManager.setRemoteSubmixOn(false, REMOTE_SUBMIX_ADDRESS); } mRemoteDisplay.dispose(); mRemoteDisplay = null; mRemoteDisplayInterface = null; mRemoteDisplayConnected = false; mHandler.removeCallbacks(mRtspTimeout); setRemoteSubmixOn(false); mHandler.post(new Runnable() { @Override public void run() { Loading Loading @@ -527,6 +529,8 @@ final class WifiDisplayController implements DumpUtils.Dump { return; // done } setRemoteSubmixOn(true); final WifiP2pDevice oldDevice = mConnectedDevice; final int port = getPortNumber(mConnectedDevice); final String iface = addr.getHostAddress() + ":" + port; Loading @@ -545,8 +549,6 @@ final class WifiDisplayController implements DumpUtils.Dump { mRemoteDisplayConnected = true; mHandler.removeCallbacks(mRtspTimeout); mAudioManager.setRemoteSubmixOn(true, REMOTE_SUBMIX_ADDRESS); final WifiDisplay display = createWifiDisplay(mConnectedDevice); mHandler.post(new Runnable() { @Override Loading Loading @@ -583,6 +585,13 @@ final class WifiDisplayController implements DumpUtils.Dump { } } private void setRemoteSubmixOn(boolean on) { if (mRemoteSubmixOn != on) { mRemoteSubmixOn = on; mAudioManager.setRemoteSubmixOn(on, REMOTE_SUBMIX_ADDRESS); } } private void handleStateChanged(boolean enabled) { if (mWifiP2pEnabled != enabled) { mWifiP2pEnabled = enabled; Loading Loading
services/java/com/android/server/display/WifiDisplayController.java +15 −6 Original line number Diff line number Diff line Loading @@ -129,6 +129,9 @@ final class WifiDisplayController implements DumpUtils.Dump { // True if RTSP has connected. private boolean mRemoteDisplayConnected; // True if the remote submix is enabled. private boolean mRemoteSubmixOn; public WifiDisplayController(Context context, Handler handler, Listener listener) { mContext = context; mHandler = handler; Loading Loading @@ -160,6 +163,7 @@ final class WifiDisplayController implements DumpUtils.Dump { pw.println("mRemoteDisplay=" + mRemoteDisplay); pw.println("mRemoteDisplayInterface=" + mRemoteDisplayInterface); pw.println("mRemoteDisplayConnected=" + mRemoteDisplayConnected); pw.println("mRemoteSubmixOn=" + mRemoteSubmixOn); pw.println("mKnownWifiDisplayPeers: size=" + mKnownWifiDisplayPeers.size()); for (WifiP2pDevice device : mKnownWifiDisplayPeers) { Loading Loading @@ -390,16 +394,14 @@ final class WifiDisplayController implements DumpUtils.Dump { Slog.i(TAG, "Stopped listening for RTSP connection on " + mRemoteDisplayInterface + " from Wifi display: " + mConnectedDevice.deviceName); if (mRemoteDisplayConnected) { mAudioManager.setRemoteSubmixOn(false, REMOTE_SUBMIX_ADDRESS); } mRemoteDisplay.dispose(); mRemoteDisplay = null; mRemoteDisplayInterface = null; mRemoteDisplayConnected = false; mHandler.removeCallbacks(mRtspTimeout); setRemoteSubmixOn(false); mHandler.post(new Runnable() { @Override public void run() { Loading Loading @@ -527,6 +529,8 @@ final class WifiDisplayController implements DumpUtils.Dump { return; // done } setRemoteSubmixOn(true); final WifiP2pDevice oldDevice = mConnectedDevice; final int port = getPortNumber(mConnectedDevice); final String iface = addr.getHostAddress() + ":" + port; Loading @@ -545,8 +549,6 @@ final class WifiDisplayController implements DumpUtils.Dump { mRemoteDisplayConnected = true; mHandler.removeCallbacks(mRtspTimeout); mAudioManager.setRemoteSubmixOn(true, REMOTE_SUBMIX_ADDRESS); final WifiDisplay display = createWifiDisplay(mConnectedDevice); mHandler.post(new Runnable() { @Override Loading Loading @@ -583,6 +585,13 @@ final class WifiDisplayController implements DumpUtils.Dump { } } private void setRemoteSubmixOn(boolean on) { if (mRemoteSubmixOn != on) { mRemoteSubmixOn = on; mAudioManager.setRemoteSubmixOn(on, REMOTE_SUBMIX_ADDRESS); } } private void handleStateChanged(boolean enabled) { if (mWifiP2pEnabled != enabled) { mWifiP2pEnabled = enabled; Loading