diff options
author | Isha Bobra <ibobra@google.com> | 2018-02-08 16:09:39 -0800 |
---|---|---|
committer | Stanley Tng <stng@google.com> | 2018-04-13 22:51:58 +0000 |
commit | 35e217f91f7797b1224f6736261f6ac26a816c1b (patch) | |
tree | c0da3a8c7bd32c7b52ac10fb8bc3481d23c3d1bd /src/com/android/settings/widget/EntityHeaderController.java | |
parent | 6baefa4b512ea42b8ec9995ab6cad9c32885fc24 (diff) |
Show only 1 entry for hearing aid devices without killing the activity.
This CL tries to detect Bluetooth hearing aid devices and tries to
combine the entry of the hearing aids with the same HiSyncIds and
show only 1 entry for each pair in the connected devices list.
This CL also shows 2 battery status in the device details page.
This change shows the combined entry after a user returns to the
settings activity after pressing the back button or somehow
without killing it. It also combines the entries just after pairing.
Test: RunSettingsRoboTests
Bug: 74204427
Change-Id: I47fb0bdd96b1cc972d88a4aef85d0113985d63bb
Diffstat (limited to 'src/com/android/settings/widget/EntityHeaderController.java')
-rw-r--r-- | src/com/android/settings/widget/EntityHeaderController.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/settings/widget/EntityHeaderController.java b/src/com/android/settings/widget/EntityHeaderController.java index 4ebc369891..5131159f14 100644 --- a/src/com/android/settings/widget/EntityHeaderController.java +++ b/src/com/android/settings/widget/EntityHeaderController.java @@ -85,6 +85,8 @@ public class EntityHeaderController { private String mIconContentDescription; private CharSequence mLabel; private CharSequence mSummary; + // Required for hearing aid devices. + private CharSequence mSecondSummary; private String mPackageName; private Intent mAppNotifPrefIntent; @UserIdInt @@ -181,6 +183,18 @@ public class EntityHeaderController { return this; } + public EntityHeaderController setSecondSummary(CharSequence summary) { + mSecondSummary = summary; + return this; + } + + public EntityHeaderController setSecondSummary(PackageInfo packageInfo) { + if (packageInfo != null) { + mSummary = packageInfo.versionName; + } + return this; + } + public EntityHeaderController setHasAppInfoLink(boolean hasAppInfoLink) { mHasAppInfoLink = hasAppInfoLink; return this; @@ -242,6 +256,7 @@ public class EntityHeaderController { } setText(R.id.entity_header_title, mLabel); setText(R.id.entity_header_summary, mSummary); + setText(R.id.entity_header_second_summary, mSecondSummary); if (mIsInstantApp) { setText(R.id.install_type, mHeader.getResources().getString(R.string.install_type_instant)); |