Loading packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaDevice.java +0 −12 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.settingslib.media; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.util.Log; Loading @@ -36,12 +35,6 @@ public class BluetoothMediaDevice extends MediaDevice { super(context, MediaDeviceType.TYPE_BLUETOOTH_DEVICE); mCachedDevice = device; initDeviceRecord(); buildConnectedState(device); } private void buildConnectedState(CachedBluetoothDevice device) { mIsConnected = device.isActiveDevice(BluetoothProfile.A2DP) || device.isActiveDevice(BluetoothProfile.HEARING_AID); } @Override Loading @@ -60,11 +53,6 @@ public class BluetoothMediaDevice extends MediaDevice { return MediaDeviceUtils.getId(mCachedDevice); } @Override public void notifyConnectedChanged() { buildConnectedState(mCachedDevice); } @Override public void connect() { //TODO(b/117129183): add callback to notify LocalMediaManager connection state. Loading packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java +18 −46 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.settingslib.media; import android.app.Notification; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.util.Log; Loading @@ -31,7 +30,6 @@ import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import java.util.ArrayList; import java.util.Collection; import java.util.List; /** Loading @@ -41,8 +39,8 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall private static final String TAG = "BluetoothMediaManager"; private final DeviceProfileNotReadyObserverCallback mObserverCallback = new DeviceProfileNotReadyObserverCallback(); private final DeviceAttributeChangeCallback mCachedDeviceCallback = new DeviceAttributeChangeCallback(); private LocalBluetoothManager mLocalBluetoothManager; private LocalBluetoothProfileManager mProfileManager; Loading @@ -50,10 +48,6 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall private MediaDevice mLastAddedDevice; private MediaDevice mLastRemovedDevice; private boolean mIsA2dpProfileReady = false; private boolean mIsHearingAidProfileReady = false; private Collection<CachedBluetoothDevice> mCachedDevices; BluetoothMediaManager(Context context, LocalBluetoothManager localBluetoothManager, Notification notification) { super(context, notification); Loading @@ -68,18 +62,6 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall mLocalBluetoothManager.getEventManager().registerCallback(this); buildBluetoothDeviceList(); dispatchDeviceListAdded(); // The profile may not ready when calling startScan(). // Device status are all disconnected since profiles are not ready to connected. // In this case, we observe all devices in CachedDeviceManager. // When one of these device is connected to profile, will call buildBluetoothDeviceList() // again to find the connected devices. if (!mIsA2dpProfileReady && !mIsHearingAidProfileReady) { mCachedDevices = mLocalBluetoothManager.getCachedDeviceManager().getCachedDevicesCopy(); for (CachedBluetoothDevice device : mCachedDevices) { device.registerCallback(mObserverCallback); } } } private void buildBluetoothDeviceList() { Loading Loading @@ -114,8 +96,6 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall addMediaDevice(cachedDevice); } } mIsA2dpProfileReady = a2dpProfile.isProfileReady(); } private void addConnectedHearingAidDevices() { Loading Loading @@ -150,14 +130,13 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall addMediaDevice(cachedDevice); } } mIsHearingAidProfileReady = hapProfile.isProfileReady(); } private void addMediaDevice(CachedBluetoothDevice cachedDevice) { MediaDevice mediaDevice = findMediaDevice(MediaDeviceUtils.getId(cachedDevice)); if (mediaDevice == null) { mediaDevice = new BluetoothMediaDevice(mContext, cachedDevice); cachedDevice.registerCallback(mCachedDeviceCallback); mLastAddedDevice = mediaDevice; mMediaDevices.add(mediaDevice); } Loading @@ -166,6 +145,16 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall @Override public void stopScan() { mLocalBluetoothManager.getEventManager().unregisterCallback(this); unregisterCachedDeviceCallback(); } private void unregisterCachedDeviceCallback() { for (MediaDevice device : mMediaDevices) { if (device instanceof BluetoothMediaDevice) { ((BluetoothMediaDevice) device).getCachedDevice() .unregisterCallback(mCachedDeviceCallback); } } } @Override Loading @@ -177,6 +166,8 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall final List<MediaDevice> removeDevicesList = new ArrayList<>(); for (MediaDevice device : mMediaDevices) { if (device instanceof BluetoothMediaDevice) { ((BluetoothMediaDevice) device).getCachedDevice() .unregisterCallback(mCachedDeviceCallback); removeDevicesList.add(device); } } Loading Loading @@ -221,6 +212,7 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall private void removeMediaDevice(CachedBluetoothDevice cachedDevice) { final MediaDevice mediaDevice = findMediaDevice(MediaDeviceUtils.getId(cachedDevice)); if (mediaDevice != null) { cachedDevice.unregisterCallback(mCachedDeviceCallback); mLastRemovedDevice = mediaDevice; mMediaDevices.remove(mediaDevice); } Loading Loading @@ -260,30 +252,10 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall dispatchDeviceRemoved(cachedDevice); } } @Override public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) { Log.d(TAG, "onActiveDeviceChanged : device : " + activeDevice + ", profile : " + bluetoothProfile); if (BluetoothProfile.HEARING_AID == bluetoothProfile || BluetoothProfile.A2DP == bluetoothProfile) { final String id = activeDevice == null ? PhoneMediaDevice.ID : MediaDeviceUtils.getId(activeDevice); dispatchActiveDeviceChanged(id); } } class DeviceProfileNotReadyObserverCallback implements CachedBluetoothDevice.Callback { class DeviceAttributeChangeCallback implements CachedBluetoothDevice.Callback { @Override public void onDeviceAttributesChanged() { if (!mIsA2dpProfileReady && !mIsHearingAidProfileReady) { for (CachedBluetoothDevice device : mCachedDevices) { device.unregisterCallback(mObserverCallback); } buildBluetoothDeviceList(); dispatchDeviceListAdded(); } dispatchDeviceAttributesChanged(); } } } packages/SettingsLib/src/com/android/settingslib/media/InfoMediaDevice.java +1 −9 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.settingslib.media; import android.content.Context; import android.widget.Toast; import androidx.mediarouter.media.MediaRouter; Loading Loading @@ -53,23 +52,16 @@ public class InfoMediaDevice extends MediaDevice { return MediaDeviceUtils.getId(mRouteInfo); } @Override public void notifyConnectedChanged() { //TODO(b/117129183): check mIsConnected state } @Override public void connect() { //TODO(b/117129183): use MediaController2 to transfer media mIsConnected = true; super.connect(); //mIsConnected = true; Toast.makeText(mContext, "This is cast device !", Toast.LENGTH_SHORT).show(); } @Override public void disconnect() { //TODO(b/117129183): disconnected last select device //mIsConnected = false; mIsConnected = false; } } packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java +13 −49 Original line number Diff line number Diff line Loading @@ -39,9 +39,6 @@ public class LocalMediaManager implements BluetoothCallback { private static final Comparator<MediaDevice> COMPARATOR = Comparator.naturalOrder(); private static final String TAG = "LocalMediaManager"; public static final String NOTIFICATION_EXTRA = "notification_extra"; public static final String NOTIFICATION_PACKAGE_NAME = "notification_package_name"; @Retention(RetentionPolicy.SOURCE) @IntDef({MediaDeviceState.STATE_CONNECTED, MediaDeviceState.STATE_CONNECTING, Loading @@ -61,6 +58,7 @@ public class LocalMediaManager implements BluetoothCallback { private InfoMediaManager mInfoMediaManager; private LocalBluetoothManager mLocalBluetoothManager; private MediaDevice mLastConnectedDevice; private MediaDevice mPhoneDevice; /** Loading Loading @@ -100,43 +98,29 @@ public class LocalMediaManager implements BluetoothCallback { * @param connectDevice the MediaDevice */ public void connectDevice(MediaDevice connectDevice) { final MediaDevice currentDevice = getCurrentConnectedDevice(); final MediaDevice device = MediaDeviceUtils.findMediaDevice(mMediaDevices, connectDevice.getId()); if (device != null && currentDevice != null && device.getId().equals(currentDevice.getId())) { if (connectDevice == mLastConnectedDevice) { return; } //TODO(b/117129183): For demo, will remove check connectDevice is InfoMediaDevice. if (currentDevice != null && !(connectDevice instanceof InfoMediaDevice)) { currentDevice.disconnect(); if (mLastConnectedDevice != null) { mLastConnectedDevice.disconnect(); } device.connect(); connectDevice.connect(); if (connectDevice.isConnected()) { mLastConnectedDevice = connectDevice; } final int state = device.isConnected() final int state = connectDevice.isConnected() ? MediaDeviceState.STATE_CONNECTED : MediaDeviceState.STATE_DISCONNECTED; dispatchSelectedDeviceStateChanged(mMediaDevices, device, state); dispatchSelectedDeviceStateChanged(connectDevice, state); } private MediaDevice getCurrentConnectedDevice() { for (MediaDevice device : mMediaDevices) { if (device.isConnected()) { return device; } } Log.w(TAG, "getCurrentConnectedDevice() cannot find current connected device !"); return null; } void dispatchSelectedDeviceStateChanged(List<MediaDevice> mMediaDevices, MediaDevice device, @MediaDeviceState int state) { void dispatchSelectedDeviceStateChanged(MediaDevice device, @MediaDeviceState int state) { synchronized (mCallbacks) { for (DeviceCallback callback : mCallbacks) { callback.onSelectedDeviceStateChanged(new ArrayList<>(mMediaDevices), device, state); callback.onSelectedDeviceStateChanged(device, state); } } } Loading Loading @@ -242,25 +226,6 @@ public class LocalMediaManager implements BluetoothCallback { public void onDeviceAttributesChanged() { dispatchDeviceListUpdate(); } @Override public void onActiveDeviceChanged(String id) { final MediaDevice currentDevice = getCurrentConnectedDevice(); final MediaDevice connectDevice = MediaDeviceUtils.findMediaDevice(mMediaDevices, id); if (connectDevice != null && currentDevice != null && connectDevice.getId().equals(currentDevice.getId())) { return; } if (currentDevice != null) { currentDevice.notifyConnectedChanged(); } if (connectDevice != null) { connectDevice.notifyConnectedChanged(); } dispatchDeviceListUpdate(); } } Loading @@ -284,7 +249,6 @@ public class LocalMediaManager implements BluetoothCallback { * {@link MediaDeviceState#STATE_CONNECTING}, * {@link MediaDeviceState#STATE_DISCONNECTED} */ void onSelectedDeviceStateChanged(List<MediaDevice> devices, MediaDevice device, @MediaDeviceState int state); void onSelectedDeviceStateChanged(MediaDevice device, @MediaDeviceState int state); } } packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java +0 −7 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.settingslib.media; import android.content.Context; import android.text.TextUtils; import android.util.Log; import androidx.annotation.IntDef; Loading Loading @@ -55,7 +54,6 @@ public abstract class MediaDevice implements Comparable<MediaDevice> { ConnectionRecordManager.getInstance().fetchLastSelectedDevice(mContext); mConnectedRecord = ConnectionRecordManager.getInstance().fetchConnectionRecord(mContext, getId()); Log.d("ttttt", getName() + " used: " + mConnectedRecord); } /** Loading Loading @@ -87,11 +85,6 @@ public abstract class MediaDevice implements Comparable<MediaDevice> { */ public abstract String getId(); /** * Notify MediaDevice to change their connected state. */ public abstract void notifyConnectedChanged(); /** * Transfer MediaDevice for media */ Loading Loading
packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaDevice.java +0 −12 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.settingslib.media; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.util.Log; Loading @@ -36,12 +35,6 @@ public class BluetoothMediaDevice extends MediaDevice { super(context, MediaDeviceType.TYPE_BLUETOOTH_DEVICE); mCachedDevice = device; initDeviceRecord(); buildConnectedState(device); } private void buildConnectedState(CachedBluetoothDevice device) { mIsConnected = device.isActiveDevice(BluetoothProfile.A2DP) || device.isActiveDevice(BluetoothProfile.HEARING_AID); } @Override Loading @@ -60,11 +53,6 @@ public class BluetoothMediaDevice extends MediaDevice { return MediaDeviceUtils.getId(mCachedDevice); } @Override public void notifyConnectedChanged() { buildConnectedState(mCachedDevice); } @Override public void connect() { //TODO(b/117129183): add callback to notify LocalMediaManager connection state. Loading
packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java +18 −46 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.settingslib.media; import android.app.Notification; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.util.Log; Loading @@ -31,7 +30,6 @@ import com.android.settingslib.bluetooth.LocalBluetoothManager; import com.android.settingslib.bluetooth.LocalBluetoothProfileManager; import java.util.ArrayList; import java.util.Collection; import java.util.List; /** Loading @@ -41,8 +39,8 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall private static final String TAG = "BluetoothMediaManager"; private final DeviceProfileNotReadyObserverCallback mObserverCallback = new DeviceProfileNotReadyObserverCallback(); private final DeviceAttributeChangeCallback mCachedDeviceCallback = new DeviceAttributeChangeCallback(); private LocalBluetoothManager mLocalBluetoothManager; private LocalBluetoothProfileManager mProfileManager; Loading @@ -50,10 +48,6 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall private MediaDevice mLastAddedDevice; private MediaDevice mLastRemovedDevice; private boolean mIsA2dpProfileReady = false; private boolean mIsHearingAidProfileReady = false; private Collection<CachedBluetoothDevice> mCachedDevices; BluetoothMediaManager(Context context, LocalBluetoothManager localBluetoothManager, Notification notification) { super(context, notification); Loading @@ -68,18 +62,6 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall mLocalBluetoothManager.getEventManager().registerCallback(this); buildBluetoothDeviceList(); dispatchDeviceListAdded(); // The profile may not ready when calling startScan(). // Device status are all disconnected since profiles are not ready to connected. // In this case, we observe all devices in CachedDeviceManager. // When one of these device is connected to profile, will call buildBluetoothDeviceList() // again to find the connected devices. if (!mIsA2dpProfileReady && !mIsHearingAidProfileReady) { mCachedDevices = mLocalBluetoothManager.getCachedDeviceManager().getCachedDevicesCopy(); for (CachedBluetoothDevice device : mCachedDevices) { device.registerCallback(mObserverCallback); } } } private void buildBluetoothDeviceList() { Loading Loading @@ -114,8 +96,6 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall addMediaDevice(cachedDevice); } } mIsA2dpProfileReady = a2dpProfile.isProfileReady(); } private void addConnectedHearingAidDevices() { Loading Loading @@ -150,14 +130,13 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall addMediaDevice(cachedDevice); } } mIsHearingAidProfileReady = hapProfile.isProfileReady(); } private void addMediaDevice(CachedBluetoothDevice cachedDevice) { MediaDevice mediaDevice = findMediaDevice(MediaDeviceUtils.getId(cachedDevice)); if (mediaDevice == null) { mediaDevice = new BluetoothMediaDevice(mContext, cachedDevice); cachedDevice.registerCallback(mCachedDeviceCallback); mLastAddedDevice = mediaDevice; mMediaDevices.add(mediaDevice); } Loading @@ -166,6 +145,16 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall @Override public void stopScan() { mLocalBluetoothManager.getEventManager().unregisterCallback(this); unregisterCachedDeviceCallback(); } private void unregisterCachedDeviceCallback() { for (MediaDevice device : mMediaDevices) { if (device instanceof BluetoothMediaDevice) { ((BluetoothMediaDevice) device).getCachedDevice() .unregisterCallback(mCachedDeviceCallback); } } } @Override Loading @@ -177,6 +166,8 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall final List<MediaDevice> removeDevicesList = new ArrayList<>(); for (MediaDevice device : mMediaDevices) { if (device instanceof BluetoothMediaDevice) { ((BluetoothMediaDevice) device).getCachedDevice() .unregisterCallback(mCachedDeviceCallback); removeDevicesList.add(device); } } Loading Loading @@ -221,6 +212,7 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall private void removeMediaDevice(CachedBluetoothDevice cachedDevice) { final MediaDevice mediaDevice = findMediaDevice(MediaDeviceUtils.getId(cachedDevice)); if (mediaDevice != null) { cachedDevice.unregisterCallback(mCachedDeviceCallback); mLastRemovedDevice = mediaDevice; mMediaDevices.remove(mediaDevice); } Loading Loading @@ -260,30 +252,10 @@ public class BluetoothMediaManager extends MediaManager implements BluetoothCall dispatchDeviceRemoved(cachedDevice); } } @Override public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) { Log.d(TAG, "onActiveDeviceChanged : device : " + activeDevice + ", profile : " + bluetoothProfile); if (BluetoothProfile.HEARING_AID == bluetoothProfile || BluetoothProfile.A2DP == bluetoothProfile) { final String id = activeDevice == null ? PhoneMediaDevice.ID : MediaDeviceUtils.getId(activeDevice); dispatchActiveDeviceChanged(id); } } class DeviceProfileNotReadyObserverCallback implements CachedBluetoothDevice.Callback { class DeviceAttributeChangeCallback implements CachedBluetoothDevice.Callback { @Override public void onDeviceAttributesChanged() { if (!mIsA2dpProfileReady && !mIsHearingAidProfileReady) { for (CachedBluetoothDevice device : mCachedDevices) { device.unregisterCallback(mObserverCallback); } buildBluetoothDeviceList(); dispatchDeviceListAdded(); } dispatchDeviceAttributesChanged(); } } }
packages/SettingsLib/src/com/android/settingslib/media/InfoMediaDevice.java +1 −9 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.settingslib.media; import android.content.Context; import android.widget.Toast; import androidx.mediarouter.media.MediaRouter; Loading Loading @@ -53,23 +52,16 @@ public class InfoMediaDevice extends MediaDevice { return MediaDeviceUtils.getId(mRouteInfo); } @Override public void notifyConnectedChanged() { //TODO(b/117129183): check mIsConnected state } @Override public void connect() { //TODO(b/117129183): use MediaController2 to transfer media mIsConnected = true; super.connect(); //mIsConnected = true; Toast.makeText(mContext, "This is cast device !", Toast.LENGTH_SHORT).show(); } @Override public void disconnect() { //TODO(b/117129183): disconnected last select device //mIsConnected = false; mIsConnected = false; } }
packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java +13 −49 Original line number Diff line number Diff line Loading @@ -39,9 +39,6 @@ public class LocalMediaManager implements BluetoothCallback { private static final Comparator<MediaDevice> COMPARATOR = Comparator.naturalOrder(); private static final String TAG = "LocalMediaManager"; public static final String NOTIFICATION_EXTRA = "notification_extra"; public static final String NOTIFICATION_PACKAGE_NAME = "notification_package_name"; @Retention(RetentionPolicy.SOURCE) @IntDef({MediaDeviceState.STATE_CONNECTED, MediaDeviceState.STATE_CONNECTING, Loading @@ -61,6 +58,7 @@ public class LocalMediaManager implements BluetoothCallback { private InfoMediaManager mInfoMediaManager; private LocalBluetoothManager mLocalBluetoothManager; private MediaDevice mLastConnectedDevice; private MediaDevice mPhoneDevice; /** Loading Loading @@ -100,43 +98,29 @@ public class LocalMediaManager implements BluetoothCallback { * @param connectDevice the MediaDevice */ public void connectDevice(MediaDevice connectDevice) { final MediaDevice currentDevice = getCurrentConnectedDevice(); final MediaDevice device = MediaDeviceUtils.findMediaDevice(mMediaDevices, connectDevice.getId()); if (device != null && currentDevice != null && device.getId().equals(currentDevice.getId())) { if (connectDevice == mLastConnectedDevice) { return; } //TODO(b/117129183): For demo, will remove check connectDevice is InfoMediaDevice. if (currentDevice != null && !(connectDevice instanceof InfoMediaDevice)) { currentDevice.disconnect(); if (mLastConnectedDevice != null) { mLastConnectedDevice.disconnect(); } device.connect(); connectDevice.connect(); if (connectDevice.isConnected()) { mLastConnectedDevice = connectDevice; } final int state = device.isConnected() final int state = connectDevice.isConnected() ? MediaDeviceState.STATE_CONNECTED : MediaDeviceState.STATE_DISCONNECTED; dispatchSelectedDeviceStateChanged(mMediaDevices, device, state); dispatchSelectedDeviceStateChanged(connectDevice, state); } private MediaDevice getCurrentConnectedDevice() { for (MediaDevice device : mMediaDevices) { if (device.isConnected()) { return device; } } Log.w(TAG, "getCurrentConnectedDevice() cannot find current connected device !"); return null; } void dispatchSelectedDeviceStateChanged(List<MediaDevice> mMediaDevices, MediaDevice device, @MediaDeviceState int state) { void dispatchSelectedDeviceStateChanged(MediaDevice device, @MediaDeviceState int state) { synchronized (mCallbacks) { for (DeviceCallback callback : mCallbacks) { callback.onSelectedDeviceStateChanged(new ArrayList<>(mMediaDevices), device, state); callback.onSelectedDeviceStateChanged(device, state); } } } Loading Loading @@ -242,25 +226,6 @@ public class LocalMediaManager implements BluetoothCallback { public void onDeviceAttributesChanged() { dispatchDeviceListUpdate(); } @Override public void onActiveDeviceChanged(String id) { final MediaDevice currentDevice = getCurrentConnectedDevice(); final MediaDevice connectDevice = MediaDeviceUtils.findMediaDevice(mMediaDevices, id); if (connectDevice != null && currentDevice != null && connectDevice.getId().equals(currentDevice.getId())) { return; } if (currentDevice != null) { currentDevice.notifyConnectedChanged(); } if (connectDevice != null) { connectDevice.notifyConnectedChanged(); } dispatchDeviceListUpdate(); } } Loading @@ -284,7 +249,6 @@ public class LocalMediaManager implements BluetoothCallback { * {@link MediaDeviceState#STATE_CONNECTING}, * {@link MediaDeviceState#STATE_DISCONNECTED} */ void onSelectedDeviceStateChanged(List<MediaDevice> devices, MediaDevice device, @MediaDeviceState int state); void onSelectedDeviceStateChanged(MediaDevice device, @MediaDeviceState int state); } }
packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java +0 −7 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.settingslib.media; import android.content.Context; import android.text.TextUtils; import android.util.Log; import androidx.annotation.IntDef; Loading Loading @@ -55,7 +54,6 @@ public abstract class MediaDevice implements Comparable<MediaDevice> { ConnectionRecordManager.getInstance().fetchLastSelectedDevice(mContext); mConnectedRecord = ConnectionRecordManager.getInstance().fetchConnectionRecord(mContext, getId()); Log.d("ttttt", getName() + " used: " + mConnectedRecord); } /** Loading Loading @@ -87,11 +85,6 @@ public abstract class MediaDevice implements Comparable<MediaDevice> { */ public abstract String getId(); /** * Notify MediaDevice to change their connected state. */ public abstract void notifyConnectedChanged(); /** * Transfer MediaDevice for media */ Loading