Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +14 −2 Original line number Diff line number Diff line Loading @@ -475,6 +475,19 @@ public class BluetoothUtils { return Uri.parse(data); } /** * Gets string metadata from Fast Pair customized fields. * * @param bluetoothDevice the BluetoothDevice to get metadata * @return the string metadata */ @Nullable public static String getFastPairCustomizedField( @Nullable BluetoothDevice bluetoothDevice, @NonNull String key) { String data = getStringMetaData(bluetoothDevice, METADATA_FAST_PAIR_CUSTOMIZED_FIELDS); return extraTagValue(key, data); } /** * Get URI Bluetooth metadata for extra control * Loading @@ -482,8 +495,7 @@ public class BluetoothUtils { * @return the URI metadata */ public static String getControlUriMetaData(BluetoothDevice bluetoothDevice) { String data = getStringMetaData(bluetoothDevice, METADATA_FAST_PAIR_CUSTOMIZED_FIELDS); return extraTagValue(KEY_HEARABLE_CONTROL_SLICE, data); return getFastPairCustomizedField(bluetoothDevice, KEY_HEARABLE_CONTROL_SLICE); } /** Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/ActionSwitchPreferenceState.java +14 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; /** A data class representing the state of an action/switch preference. */ public class ActionSwitchPreferenceState extends DeviceSettingPreferenceState Loading Loading @@ -133,4 +136,15 @@ public class ActionSwitchPreferenceState extends DeviceSettingPreferenceState public Bundle getExtras() { return mExtras; } @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof ActionSwitchPreferenceState other)) return false; return mChecked == other.mChecked; } @Override public int hashCode() { return Objects.hash(mChecked); } } packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/DeviceInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; Loading Loading @@ -134,4 +135,15 @@ public class DeviceInfo implements Parcelable { public Bundle getExtras() { return mExtras; } @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof DeviceInfo other)) return false; return Objects.equals(mBluetoothAddress, other.getBluetoothAddress()); } @Override public int hashCode() { return Objects.hash(mBluetoothAddress); } } packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/DeviceSettingState.java +13 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; Loading Loading @@ -162,4 +163,16 @@ public class DeviceSettingState implements Parcelable { public Bundle getExtras() { return mExtras; } @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof DeviceSettingState other)) return false; return mSettingId == other.mSettingId && Objects.equals(mPreferenceState, other.mPreferenceState); } @Override public int hashCode() { return Objects.hash(mSettingId, mPreferenceState); } } packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/IDeviceSettingsConfigProviderService.aidl 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settingslib.bluetooth.devicesettings; import com.android.settingslib.bluetooth.devicesettings.DeviceInfo; import com.android.settingslib.bluetooth.devicesettings.DeviceSettingsConfig; interface IDeviceSettingsConfigProviderService { DeviceSettingsConfig getDeviceSettingsConfig(in DeviceInfo device); } No newline at end of file Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +14 −2 Original line number Diff line number Diff line Loading @@ -475,6 +475,19 @@ public class BluetoothUtils { return Uri.parse(data); } /** * Gets string metadata from Fast Pair customized fields. * * @param bluetoothDevice the BluetoothDevice to get metadata * @return the string metadata */ @Nullable public static String getFastPairCustomizedField( @Nullable BluetoothDevice bluetoothDevice, @NonNull String key) { String data = getStringMetaData(bluetoothDevice, METADATA_FAST_PAIR_CUSTOMIZED_FIELDS); return extraTagValue(key, data); } /** * Get URI Bluetooth metadata for extra control * Loading @@ -482,8 +495,7 @@ public class BluetoothUtils { * @return the URI metadata */ public static String getControlUriMetaData(BluetoothDevice bluetoothDevice) { String data = getStringMetaData(bluetoothDevice, METADATA_FAST_PAIR_CUSTOMIZED_FIELDS); return extraTagValue(KEY_HEARABLE_CONTROL_SLICE, data); return getFastPairCustomizedField(bluetoothDevice, KEY_HEARABLE_CONTROL_SLICE); } /** Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/ActionSwitchPreferenceState.java +14 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; /** A data class representing the state of an action/switch preference. */ public class ActionSwitchPreferenceState extends DeviceSettingPreferenceState Loading Loading @@ -133,4 +136,15 @@ public class ActionSwitchPreferenceState extends DeviceSettingPreferenceState public Bundle getExtras() { return mExtras; } @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof ActionSwitchPreferenceState other)) return false; return mChecked == other.mChecked; } @Override public int hashCode() { return Objects.hash(mChecked); } }
packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/DeviceInfo.java +12 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; Loading Loading @@ -134,4 +135,15 @@ public class DeviceInfo implements Parcelable { public Bundle getExtras() { return mExtras; } @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof DeviceInfo other)) return false; return Objects.equals(mBluetoothAddress, other.getBluetoothAddress()); } @Override public int hashCode() { return Objects.hash(mBluetoothAddress); } }
packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/DeviceSettingState.java +13 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import java.util.Objects; Loading Loading @@ -162,4 +163,16 @@ public class DeviceSettingState implements Parcelable { public Bundle getExtras() { return mExtras; } @Override public boolean equals(@Nullable Object obj) { if (!(obj instanceof DeviceSettingState other)) return false; return mSettingId == other.mSettingId && Objects.equals(mPreferenceState, other.mPreferenceState); } @Override public int hashCode() { return Objects.hash(mSettingId, mPreferenceState); } }
packages/SettingsLib/src/com/android/settingslib/bluetooth/devicesettings/IDeviceSettingsConfigProviderService.aidl 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.settingslib.bluetooth.devicesettings; import com.android.settingslib.bluetooth.devicesettings.DeviceInfo; import com.android.settingslib.bluetooth.devicesettings.DeviceSettingsConfig; interface IDeviceSettingsConfigProviderService { DeviceSettingsConfig getDeviceSettingsConfig(in DeviceInfo device); } No newline at end of file