use of com.android.settingslib.media.LocalMediaManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class MediaDeviceUpdateWorker method onSlicePinned.
@Override
protected void onSlicePinned() {
mMediaDevices.clear();
if (mLocalMediaManager == null) {
mLocalMediaManager = new LocalMediaManager(mContext, mPackageName, null);
}
mLocalMediaManager.registerCallback(this);
mLocalMediaManager.startScan();
}
use of com.android.settingslib.media.LocalMediaManager in project android_packages_apps_Settings by omnirom.
the class MediaDeviceUpdateWorker method onSlicePinned.
@Override
protected void onSlicePinned() {
mMediaDevices.clear();
mIsTouched = false;
if (mLocalMediaManager == null || !TextUtils.equals(mPackageName, mLocalMediaManager.getPackageName())) {
mLocalMediaManager = new LocalMediaManager(mContext, mPackageName, null);
}
mLocalMediaManager.registerCallback(this);
final IntentFilter intentFilter = new IntentFilter(STREAM_DEVICES_CHANGED_ACTION);
mContext.registerReceiver(mReceiver, intentFilter);
mLocalMediaManager.startScan();
}
use of com.android.settingslib.media.LocalMediaManager in project android_packages_apps_Settings by omnirom.
the class MediaOutputIndicatorWorker method onSlicePinned.
@Override
protected void onSlicePinned() {
mMediaDevices.clear();
mLocalBluetoothManager = Utils.getLocalBtManager(getContext());
if (mLocalBluetoothManager == null) {
Log.e(TAG, "Bluetooth is not supported on this device");
return;
}
final IntentFilter intentFilter = new IntentFilter(STREAM_DEVICES_CHANGED_ACTION);
mContext.registerReceiver(mReceiver, intentFilter);
mLocalBluetoothManager.getEventManager().registerCallback(this);
ThreadUtils.postOnBackgroundThread(() -> {
final MediaController controller = getActiveLocalMediaController();
if (controller == null) {
mPackageName = null;
} else {
mPackageName = controller.getPackageName();
}
if (mLocalMediaManager == null || !TextUtils.equals(mPackageName, mLocalMediaManager.getPackageName())) {
mLocalMediaManager = new LocalMediaManager(mContext, mPackageName, null);
}
mLocalMediaManager.registerCallback(this);
mLocalMediaManager.startScan();
});
}
Aggregations