Skip to content

Commit

Permalink
fix(browser-select-setting): don't query user's browser (excessive-pe…
Browse files Browse the repository at this point in the history
…rmissions)
  • Loading branch information
LucasGGamerM committed May 12, 2024
1 parent faee3e3 commit 0700274
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 0 additions & 4 deletions mastodon/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
<intent>
<action android:name="android.intent.action.TRANSLATE" />
</intent>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="http"/>
</intent>
</queries>

<application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ private void onLoadNewPostsClick(){

private void onCustomTabsClick(ListItem<?> item){
// GlobalUserPreferences.useCustomTabs=customTabsItem.checked;
Intent intent=new Intent(Intent.ACTION_VIEW, Uri.parse("http://example.com"));
ResolveInfo info=getActivity().getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
final String browserName;
if(info==null){
browserName="??";
}else{
browserName=info.loadLabel(getActivity().getPackageManager()).toString();
}
// Intent intent=new Intent(Intent.ACTION_VIEW, Uri.parse("http://example.com"));
// ResolveInfo info=getActivity().getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
final String browserName = getContext().getString(R.string.system_browser);
// if(info==null){
// browserName="??";
// }else{
// browserName=info.loadLabel(getActivity().getPackageManager()).toString();
// }
ArrayAdapter<CharSequence> adapter=new ArrayAdapter<>(getActivity(), R.layout.item_alert_single_choice_2lines_but_different, R.id.text,
new String[]{getString(R.string.in_app_browser), getString(R.string.system_browser)}){
@Override
Expand Down

0 comments on commit 0700274

Please sign in to comment.