Fix software shortcut in dialog did not update when content change.
Root Cause: Dialog only get updated when clicked the trigger button to show dialog. Solution: Update the software shortcut content in dialog if needed in onResume() stage. Bug: 183342594 Test: atest AccessibilityDialogUtilsTest Change-Id: Ibcd66d6c57f1790f96f234e49f456cbc2c990f64
This commit is contained in:
@@ -180,6 +180,23 @@ public class AccessibilityDialogUtils {
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the software shortcut in edit shortcut dialog.
|
||||
*
|
||||
* @param context A valid context
|
||||
* @param editShortcutDialog Need to be a type of edit shortcut dialog
|
||||
* @return True if the update is successful
|
||||
*/
|
||||
public static boolean updateSoftwareShortcutInDialog(Context context,
|
||||
Dialog editShortcutDialog) {
|
||||
final View container = editShortcutDialog.findViewById(R.id.container_layout);
|
||||
if (container != null) {
|
||||
initSoftwareShortcut(context, container);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static AlertDialog createDialog(Context context, int dialogType,
|
||||
CharSequence dialogTitle, DialogInterface.OnClickListener listener) {
|
||||
|
||||
|
Reference in New Issue
Block a user