Remove hardcoded Uri to get slice settings

Now we get it from BluetoothDevice.getMetaData()

Bug: 124121451
Test: RunSettingsRoboTests
Change-Id: Id96480f257b93dd03bb290c954e01cde9dcf30ad
This commit is contained in:
jackqdyulei
2019-02-22 13:19:36 -08:00
parent 5e5dd25b8f
commit c51e5aae59
5 changed files with 24 additions and 17 deletions

View File

@@ -16,11 +16,10 @@
package com.android.settings.bluetooth;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.net.Uri;
import com.android.settings.R;
/**
* Impl of {@link BluetoothFeatureProvider}
*/
@@ -33,9 +32,9 @@ public class BluetoothFeatureProviderImpl implements BluetoothFeatureProvider {
}
@Override
public Uri getBluetoothDeviceSettingsUri(String macAddress) {
final String uriString = mContext.getString(R.string.config_bluetooth_device_settings_uri,
macAddress);
return Uri.parse(uriString);
public Uri getBluetoothDeviceSettingsUri(BluetoothDevice bluetoothDevice) {
final String uriString = bluetoothDevice.getMetadata(
BluetoothDevice.METADATA_ENHANCED_SETTINGS_UI_URI);
return uriString != null ? Uri.parse(uriString) : null;
}
}