Loading media/java/android/media/AudioManager.java +21 −19 Original line number Diff line number Diff line Loading @@ -4718,7 +4718,7 @@ public class AudioManager { NativeEventHandlerDelegate delegate = new NativeEventHandlerDelegate(callback, handler); mDeviceCallbacks.put(callback, delegate); broadcastDeviceListChange(delegate.getHandler()); broadcastDeviceListChange_sync(delegate.getHandler()); } } } Loading Loading @@ -4837,9 +4837,9 @@ public class AudioManager { /** * Internal method to compute and generate add/remove messages and then send to any * registered callbacks. * registered callbacks. Must be called synchronized on mDeviceCallbacks. */ private void broadcastDeviceListChange(Handler handler) { private void broadcastDeviceListChange_sync(Handler handler) { int status; // Get the new current set of ports Loading @@ -4861,7 +4861,6 @@ public class AudioManager { AudioDeviceInfo[] removed_devices = calcListDeltas(current_ports, mPreviousPorts, GET_DEVICES_ALL); if (added_devices.length != 0 || removed_devices.length != 0) { synchronized (mDeviceCallbacks) { for (int i = 0; i < mDeviceCallbacks.size(); i++) { handler = mDeviceCallbacks.valueAt(i).getHandler(); if (handler != null) { Loading @@ -4879,7 +4878,6 @@ public class AudioManager { } } } } mPreviousPorts = current_ports; } Loading @@ -4890,7 +4888,9 @@ public class AudioManager { private class OnAmPortUpdateListener implements AudioManager.OnAudioPortUpdateListener { static final String TAG = "OnAmPortUpdateListener"; public void onAudioPortListUpdate(AudioPort[] portList) { broadcastDeviceListChange(null); synchronized (mDeviceCallbacks) { broadcastDeviceListChange_sync(null); } } /** Loading @@ -4904,7 +4904,9 @@ public class AudioManager { * Callback method called when the mediaserver dies */ public void onServiceDied() { broadcastDeviceListChange(null); synchronized (mDeviceCallbacks) { broadcastDeviceListChange_sync(null); } } } Loading Loading
media/java/android/media/AudioManager.java +21 −19 Original line number Diff line number Diff line Loading @@ -4718,7 +4718,7 @@ public class AudioManager { NativeEventHandlerDelegate delegate = new NativeEventHandlerDelegate(callback, handler); mDeviceCallbacks.put(callback, delegate); broadcastDeviceListChange(delegate.getHandler()); broadcastDeviceListChange_sync(delegate.getHandler()); } } } Loading Loading @@ -4837,9 +4837,9 @@ public class AudioManager { /** * Internal method to compute and generate add/remove messages and then send to any * registered callbacks. * registered callbacks. Must be called synchronized on mDeviceCallbacks. */ private void broadcastDeviceListChange(Handler handler) { private void broadcastDeviceListChange_sync(Handler handler) { int status; // Get the new current set of ports Loading @@ -4861,7 +4861,6 @@ public class AudioManager { AudioDeviceInfo[] removed_devices = calcListDeltas(current_ports, mPreviousPorts, GET_DEVICES_ALL); if (added_devices.length != 0 || removed_devices.length != 0) { synchronized (mDeviceCallbacks) { for (int i = 0; i < mDeviceCallbacks.size(); i++) { handler = mDeviceCallbacks.valueAt(i).getHandler(); if (handler != null) { Loading @@ -4879,7 +4878,6 @@ public class AudioManager { } } } } mPreviousPorts = current_ports; } Loading @@ -4890,7 +4888,9 @@ public class AudioManager { private class OnAmPortUpdateListener implements AudioManager.OnAudioPortUpdateListener { static final String TAG = "OnAmPortUpdateListener"; public void onAudioPortListUpdate(AudioPort[] portList) { broadcastDeviceListChange(null); synchronized (mDeviceCallbacks) { broadcastDeviceListChange_sync(null); } } /** Loading @@ -4904,7 +4904,9 @@ public class AudioManager { * Callback method called when the mediaserver dies */ public void onServiceDied() { broadcastDeviceListChange(null); synchronized (mDeviceCallbacks) { broadcastDeviceListChange_sync(null); } } } Loading