Merge changes Iceadf4a1,If2b6b06b into main
* changes:
Final (?) touches to people/apps/sound circles
Show icons for allowed contacts
diff --git a/res/layout/dialog_custom_body_audio_sharing.xml b/res/layout/dialog_custom_body_audio_sharing.xml
index 388a4941..2e8c506 100644
--- a/res/layout/dialog_custom_body_audio_sharing.xml
+++ b/res/layout/dialog_custom_body_audio_sharing.xml
@@ -15,57 +15,62 @@
~ limitations under the License.
-->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingHorizontal="?android:dialogPreferredPadding"
- android:paddingBottom="?android:dialogPreferredPadding">
+ android:scrollbars="none">
- <TextView
- android:id="@+id/description_text"
- style="@style/DeviceAudioSharingText"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:paddingBottom="24dp"
- android:visibility="gone" />
+ android:orientation="vertical"
+ android:paddingBottom="?android:dialogPreferredPadding"
+ android:paddingHorizontal="?android:dialogPreferredPadding">
- <ImageView
- android:id="@+id/description_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:contentDescription="@null"
- android:visibility="gone" />
+ <TextView
+ android:id="@+id/description_text"
+ style="@style/DeviceAudioSharingText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:paddingBottom="24dp"
+ android:visibility="gone" />
- <androidx.recyclerview.widget.RecyclerView
- android:id="@+id/device_btn_list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:nestedScrollingEnabled="false"
- android:overScrollMode="never"
- android:visibility="gone" />
+ <ImageView
+ android:id="@+id/description_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:contentDescription="@null"
+ android:visibility="gone" />
- <Button
- android:id="@+id/positive_btn"
- style="@style/SettingsLibActionButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginTop="4dp"
- android:background="@drawable/audio_sharing_rounded_bg_ripple"
- android:visibility="gone" />
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/device_btn_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:nestedScrollingEnabled="false"
+ android:overScrollMode="never"
+ android:visibility="gone" />
- <Button
- android:id="@+id/negative_btn"
- style="@style/SettingsLibActionButton"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginTop="4dp"
- android:background="@drawable/audio_sharing_rounded_bg_ripple"
- android:visibility="gone" />
-</LinearLayout>
\ No newline at end of file
+ <Button
+ android:id="@+id/positive_btn"
+ style="@style/SettingsLibActionButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginTop="4dp"
+ android:background="@drawable/audio_sharing_rounded_bg_ripple"
+ android:visibility="gone" />
+
+ <Button
+ android:id="@+id/negative_btn"
+ style="@style/SettingsLibActionButton"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_marginTop="4dp"
+ android:background="@drawable/audio_sharing_rounded_bg_ripple"
+ android:visibility="gone" />
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java
index e45657f..0f52053 100644
--- a/src/com/android/settings/applications/AppStorageSettings.java
+++ b/src/com/android/settings/applications/AppStorageSettings.java
@@ -324,9 +324,11 @@
private void initMoveDialog() {
final Context context = getActivity();
final StorageManager storage = context.getSystemService(StorageManager.class);
-
- final List<VolumeInfo> candidates = context.getPackageManager()
- .getPackageCandidateVolumes(mAppEntry.info);
+ final PackageManager pm = context.getPackageManager();
+ final List<VolumeInfo> candidates =
+ mAppEntry != null && pm != null
+ ? pm.getPackageCandidateVolumes(mAppEntry.info)
+ : Collections.emptyList();
if (candidates.size() > 1) {
Collections.sort(candidates, VolumeInfo.getDescriptionComparator());