Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5aebb69e authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Android (Google) Code Review
Browse files

Merge "Handle invalid permission group icon"

parents 0408b783 6b191200
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -397,11 +397,17 @@ public class GrantPermissionsActivity extends OverlayTouchActivity
                    // Fallback to system.
                    resources = Resources.getSystem();
                }
                int icon = groupState.mGroup.getIconResId();

                Icon icon;
                try {
                    icon = Icon.createWithResource(resources, groupState.mGroup.getIconResId());
                } catch (Resources.NotFoundException e) {
                    Log.e(LOG_TAG, "Cannot load icon for group" + groupState.mGroup.getName(), e);
                    icon = null;
                }

                mViewHandler.updateUi(groupState.mGroup.getName(), groupCount, currentIndex,
                        Icon.createWithResource(resources, icon), message,
                        groupState.mGroup.isUserSet());
                        icon, message, groupState.mGroup.isUserSet());
                return true;
            }

+3 −1
Original line number Diff line number Diff line
@@ -312,7 +312,9 @@ public class GrantPermissionsViewHandlerImpl implements GrantPermissionsViewHand
    }

    private void updateDescription() {
        if (mGroupIcon != null) {
            mIconView.setImageDrawable(mGroupIcon.loadDrawable(mActivity));
        }
        mMessageView.setText(mGroupMessage);
    }

+5 −1
Original line number Diff line number Diff line
@@ -84,7 +84,11 @@ public final class GrantPermissionsViewHandlerImpl implements GrantPermissionsVi
        mGroupName = groupName;

        mMessageView.setText(message);

        if (icon != null) {
            mIconView.setImageIcon(icon);
        }

        mHardDenyButton.setVisibility(showDoNotAsk ? View.VISIBLE : View.GONE);
        if (groupCount > 1) {
            mCurrentGroupView.setVisibility(View.VISIBLE);