Whitelist action insert

pull/182/head
M66B 4 years ago
parent d62a367a6e
commit be60e5f07a

@ -63,6 +63,14 @@
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
<intent>
<action android:name="android.intent.action.INSERT" />
</intent>
<intent>
<action android:name="android.intent.action.PICK" />
</intent>
<intent>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.OPENABLE" />

@ -27,6 +27,7 @@ import android.content.res.ColorStateList;
import android.graphics.BitmapFactory;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.text.SpannableString;
@ -217,7 +218,8 @@ public class AdapterContact extends RecyclerView.Adapter<AdapterContact.ViewHold
if (contact.state != EntityContact.STATE_IGNORE)
popupMenu.getMenu().add(Menu.NONE, R.string.title_advanced_never_favorite, 1, R.string.title_advanced_never_favorite);
if (share.resolveActivity(context.getPackageManager()) != null) // system whitelisted
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
share.resolveActivity(context.getPackageManager()) != null)
popupMenu.getMenu().add(Menu.NONE, R.string.title_share, 2, R.string.title_share);
if (ShortcutManagerCompat.isRequestPinShortcutSupported(context))
popupMenu.getMenu().add(Menu.NONE, R.string.title_pin, 3, R.string.title_pin);

@ -2645,7 +2645,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
context.startActivity(reply);
}
} else if (result instanceof Intent) {
context.startActivity((Intent) result);
try {
context.startActivity((Intent) result);
} catch (ActivityNotFoundException ex) {
ToastEx.makeText(context, context.getString(R.string.title_no_viewer, result), Toast.LENGTH_LONG).show();
}
}
}
@ -3306,7 +3310,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
insert.setType(ContactsContract.Contacts.CONTENT_TYPE);
PackageManager pm = context.getPackageManager();
if (insert.resolveActivity(pm) == null) // system whitelisted
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R && // should be system whitelisted
insert.resolveActivity(pm) == null)
Snackbar.make(parentFragment.getView(),
R.string.title_no_contacts, Snackbar.LENGTH_LONG).show();
else
@ -4456,7 +4461,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
PackageManager pm = context.getPackageManager();
if (intent.resolveActivity(pm) == null) // system whitelisted
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R &&
intent.resolveActivity(pm) == null) // system whitelisted
Snackbar.make(parentFragment.getView(),
context.getString(R.string.title_no_viewer, intent),
Snackbar.LENGTH_LONG).

Loading…
Cancel
Save