diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-01-15 00:09:06 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-01-15 00:09:06 +0000 |
commit | 3097c787d5544d8db85428a947eef052c27f4869 (patch) | |
tree | 13b811f184949a83dd7e206512ed7e55d1a72dae | |
parent | 16a0dc6f5d0bbfb98850d501632ce50a05284866 (diff) | |
parent | a2663476a16177afd1240e924e90c80ceaf601ce (diff) |
Snap for 7083118 from a2663476a16177afd1240e924e90c80ceaf601ce to rvc-qpr3-release
Change-Id: I5f86cc85f959f9b4a672a173ca72d5851d74b480
-rw-r--r-- | src/com/android/providers/media/PermissionActivity.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/providers/media/PermissionActivity.java b/src/com/android/providers/media/PermissionActivity.java index 0d721f95..d153b46d 100644 --- a/src/com/android/providers/media/PermissionActivity.java +++ b/src/com/android/providers/media/PermissionActivity.java @@ -175,13 +175,26 @@ public class PermissionActivity extends Activity { } final AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(resolveTitleText()); + // We set the title in message so that the text doesn't get truncated + builder.setMessage(resolveTitleText()); builder.setPositiveButton(R.string.allow, this::onPositiveAction); builder.setNegativeButton(R.string.deny, this::onNegativeAction); builder.setCancelable(false); builder.setView(bodyView); final AlertDialog dialog = builder.show(); + + // The title is being set as a message above. + // We need to style it like the default AlertDialog title + TextView dialogMessage = (TextView) dialog.findViewById( + android.R.id.message); + if (dialogMessage != null) { + dialogMessage.setTextAppearance( + android.R.style.TextAppearance_DeviceDefault_DialogWindowTitle); + } else { + Log.w(TAG, "Couldn't find message element"); + } + final WindowManager.LayoutParams params = dialog.getWindow().getAttributes(); params.width = getResources().getDimensionPixelSize(R.dimen.permission_dialog_width); dialog.getWindow().setAttributes(params); |