mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1048387 r=snorp
This commit is contained in:
parent
b6b7b24a4b
commit
dbb9414e04
@ -979,27 +979,37 @@ public class GeckoAppShell
|
||||
}
|
||||
|
||||
static boolean hasHandlersForIntent(Intent intent) {
|
||||
PackageManager pm = getContext().getPackageManager();
|
||||
List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
|
||||
return !list.isEmpty();
|
||||
try {
|
||||
PackageManager pm = getContext().getPackageManager();
|
||||
List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
|
||||
return !list.isEmpty();
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Exception in GeckoAppShell.hasHandlersForIntent");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static String[] getHandlersForIntent(Intent intent) {
|
||||
PackageManager pm = getContext().getPackageManager();
|
||||
List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
|
||||
int numAttr = 4;
|
||||
String[] ret = new String[list.size() * numAttr];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ResolveInfo resolveInfo = list.get(i);
|
||||
ret[i * numAttr] = resolveInfo.loadLabel(pm).toString();
|
||||
if (resolveInfo.isDefault)
|
||||
ret[i * numAttr + 1] = "default";
|
||||
else
|
||||
ret[i * numAttr + 1] = "";
|
||||
ret[i * numAttr + 2] = resolveInfo.activityInfo.applicationInfo.packageName;
|
||||
ret[i * numAttr + 3] = resolveInfo.activityInfo.name;
|
||||
try {
|
||||
PackageManager pm = getContext().getPackageManager();
|
||||
List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);
|
||||
int numAttr = 4;
|
||||
String[] ret = new String[list.size() * numAttr];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
ResolveInfo resolveInfo = list.get(i);
|
||||
ret[i * numAttr] = resolveInfo.loadLabel(pm).toString();
|
||||
if (resolveInfo.isDefault)
|
||||
ret[i * numAttr + 1] = "default";
|
||||
else
|
||||
ret[i * numAttr + 1] = "";
|
||||
ret[i * numAttr + 2] = resolveInfo.activityInfo.applicationInfo.packageName;
|
||||
ret[i * numAttr + 3] = resolveInfo.activityInfo.name;
|
||||
}
|
||||
return ret;
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOGTAG, "Exception in GeckoAppShell.getHandlersForIntent");
|
||||
return new String[0];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Intent getIntentForActionString(String aAction) {
|
||||
|
Loading…
Reference in New Issue
Block a user