[Android] Hide BAT icon on tablet when rewards disabled by policy (#35400)
The maybeHideRewardsLayout() method controls rewards icon visibility on tablets based on width but didn't check BraveRewardsPolicy, causing it to override the main visibility logic that correctly hides the icon when rewards are disabled. Resolves: https://github.com/brave/brave-browser/issues/54358
This commit is contained in:
@@ -1760,8 +1760,11 @@ public abstract class BraveToolbarLayoutImpl extends ToolbarLayout
|
||||
return;
|
||||
}
|
||||
|
||||
Tab tab = getToolbarDataProvider().getTab();
|
||||
Profile profile = tab != null ? Profile.fromWebContents(tab.getWebContents()) : null;
|
||||
mRewardsLayout.setVisibility(
|
||||
width >= DeviceFormFactor.getNonMultiDisplayMinimumTabletWidthPx(getContext())
|
||||
&& !BraveRewardsPolicy.isDisabledByPolicy(profile)
|
||||
? View.VISIBLE
|
||||
: View.GONE);
|
||||
// Update the shields layout background to match the rewards layout visibility.
|
||||
|
||||
Reference in New Issue
Block a user