Loading res/layout-sw320dp/settings_entity_header.xml +11 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,17 @@ android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> <TextView android:id="@+id/entity_header_second_summary" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:singleLine="true" android:ellipsize="marquee" android:textAlignment="viewStart" android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> </LinearLayout> </LinearLayout> Loading res/layout/settings_entity_header.xml +11 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,17 @@ android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> <TextView android:id="@+id/entity_header_second_summary" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:singleLine="true" android:ellipsize="marquee" android:textAlignment="viewStart" android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> </LinearLayout> <LinearLayout Loading src/com/android/settings/bluetooth/BluetoothDetailsHeaderController.java +15 −1 Original line number Diff line number Diff line Loading @@ -22,11 +22,14 @@ import android.support.v14.preference.PreferenceFragment; import android.support.v7.preference.PreferenceScreen; import android.util.Pair; import com.android.internal.annotations.VisibleForTesting; import com.android.settings.R; import com.android.settings.applications.LayoutPreference; import com.android.settings.widget.EntityHeaderController; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.core.lifecycle.Lifecycle; import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager; import com.android.settingslib.bluetooth.LocalBluetoothManager; /** * This class adds a header with device name and status (connected/disconnected, etc.). Loading @@ -35,10 +38,15 @@ public class BluetoothDetailsHeaderController extends BluetoothDetailsController private static final String KEY_DEVICE_HEADER = "bluetooth_device_header"; private EntityHeaderController mHeaderController; private LocalBluetoothManager mLocalManager; private CachedBluetoothDeviceManager mDeviceManager; public BluetoothDetailsHeaderController(Context context, PreferenceFragment fragment, CachedBluetoothDevice device, Lifecycle lifecycle) { CachedBluetoothDevice device, Lifecycle lifecycle, LocalBluetoothManager bluetoothManager) { super(context, fragment, device, lifecycle); mLocalManager = bluetoothManager; mDeviceManager = mLocalManager.getCachedDeviceManager(); } @Override Loading @@ -55,6 +63,12 @@ public class BluetoothDetailsHeaderController extends BluetoothDetailsController .getBtClassDrawableWithDescription(mContext, mCachedDevice, mContext.getResources().getFraction(R.fraction.bt_battery_scale_fraction, 1, 1)); String summaryText = mCachedDevice.getConnectionSummary(); // If both the hearing aids are connected, two battery status should be shown. final String pairDeviceSummary = mDeviceManager .getHearingAidPairDeviceSummary(mCachedDevice); if (pairDeviceSummary != null) { mHeaderController.setSecondSummary(pairDeviceSummary); } mHeaderController.setLabel(mCachedDevice.getName()); mHeaderController.setIcon(pair.first); mHeaderController.setIconContentDescription(pair.second); Loading src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment if (mCachedDevice != null) { Lifecycle lifecycle = getLifecycle(); controllers.add(new BluetoothDetailsHeaderController(context, this, mCachedDevice, lifecycle)); lifecycle, mManager)); controllers.add(new BluetoothDetailsButtonsController(context, this, mCachedDevice, lifecycle)); controllers.add(new BluetoothDetailsProfilesController(context, this, mManager, Loading src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java +6 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,12 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback { } @Override public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) {} public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) { // Used to combine the hearing aid entries just after pairing. Once both the hearing aids // get connected and their hiSyncId gets populated, this gets called for one of the // 2 hearing aids so that only one entry in the connected devices list will be seen. removePreference(cachedDevice); } @Override public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) { Loading Loading
res/layout-sw320dp/settings_entity_header.xml +11 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,17 @@ android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> <TextView android:id="@+id/entity_header_second_summary" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:singleLine="true" android:ellipsize="marquee" android:textAlignment="viewStart" android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> </LinearLayout> </LinearLayout> Loading
res/layout/settings_entity_header.xml +11 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,17 @@ android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> <TextView android:id="@+id/entity_header_second_summary" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="start" android:singleLine="true" android:ellipsize="marquee" android:textAlignment="viewStart" android:textAppearance="@android:style/TextAppearance.Material.Body1" android:textColor="?android:attr/textColorSecondary" /> </LinearLayout> <LinearLayout Loading
src/com/android/settings/bluetooth/BluetoothDetailsHeaderController.java +15 −1 Original line number Diff line number Diff line Loading @@ -22,11 +22,14 @@ import android.support.v14.preference.PreferenceFragment; import android.support.v7.preference.PreferenceScreen; import android.util.Pair; import com.android.internal.annotations.VisibleForTesting; import com.android.settings.R; import com.android.settings.applications.LayoutPreference; import com.android.settings.widget.EntityHeaderController; import com.android.settingslib.bluetooth.CachedBluetoothDevice; import com.android.settingslib.core.lifecycle.Lifecycle; import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager; import com.android.settingslib.bluetooth.LocalBluetoothManager; /** * This class adds a header with device name and status (connected/disconnected, etc.). Loading @@ -35,10 +38,15 @@ public class BluetoothDetailsHeaderController extends BluetoothDetailsController private static final String KEY_DEVICE_HEADER = "bluetooth_device_header"; private EntityHeaderController mHeaderController; private LocalBluetoothManager mLocalManager; private CachedBluetoothDeviceManager mDeviceManager; public BluetoothDetailsHeaderController(Context context, PreferenceFragment fragment, CachedBluetoothDevice device, Lifecycle lifecycle) { CachedBluetoothDevice device, Lifecycle lifecycle, LocalBluetoothManager bluetoothManager) { super(context, fragment, device, lifecycle); mLocalManager = bluetoothManager; mDeviceManager = mLocalManager.getCachedDeviceManager(); } @Override Loading @@ -55,6 +63,12 @@ public class BluetoothDetailsHeaderController extends BluetoothDetailsController .getBtClassDrawableWithDescription(mContext, mCachedDevice, mContext.getResources().getFraction(R.fraction.bt_battery_scale_fraction, 1, 1)); String summaryText = mCachedDevice.getConnectionSummary(); // If both the hearing aids are connected, two battery status should be shown. final String pairDeviceSummary = mDeviceManager .getHearingAidPairDeviceSummary(mCachedDevice); if (pairDeviceSummary != null) { mHeaderController.setSecondSummary(pairDeviceSummary); } mHeaderController.setLabel(mCachedDevice.getName()); mHeaderController.setIcon(pair.first); mHeaderController.setIconContentDescription(pair.second); Loading
src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment if (mCachedDevice != null) { Lifecycle lifecycle = getLifecycle(); controllers.add(new BluetoothDetailsHeaderController(context, this, mCachedDevice, lifecycle)); lifecycle, mManager)); controllers.add(new BluetoothDetailsButtonsController(context, this, mCachedDevice, lifecycle)); controllers.add(new BluetoothDetailsProfilesController(context, this, mManager, Loading
src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java +6 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,12 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback { } @Override public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) {} public void onDeviceDeleted(CachedBluetoothDevice cachedDevice) { // Used to combine the hearing aid entries just after pairing. Once both the hearing aids // get connected and their hiSyncId gets populated, this gets called for one of the // 2 hearing aids so that only one entry in the connected devices list will be seen. removePreference(cachedDevice); } @Override public void onDeviceBondStateChanged(CachedBluetoothDevice cachedDevice, int bondState) { Loading