You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
implement passing a URI to open inside the application
Supported URI schemes will also be added to the .desktop file for --install The URI is passed as named parameter --uri. This allows us to use unnamed parameters for split APK apps in the future
This commit is contained in:
@@ -9,6 +9,7 @@ public class IntentFilter {
|
||||
|
||||
private List<String> actions = new ArrayList<>();
|
||||
private Set<String> categories = new HashSet<>();
|
||||
private List<String> dataSchemes = new ArrayList<>();
|
||||
|
||||
public IntentFilter() {}
|
||||
public IntentFilter(String action) {
|
||||
@@ -42,4 +43,20 @@ public class IntentFilter {
|
||||
}
|
||||
|
||||
public void setPriority(int priority) {}
|
||||
|
||||
public void addDataScheme(String dataScheme) {
|
||||
dataSchemes.add(dataScheme);
|
||||
}
|
||||
|
||||
public boolean hasDataScheme(String dataScheme) {
|
||||
return dataSchemes.contains(dataScheme);
|
||||
}
|
||||
|
||||
public int countDataSchemes() {
|
||||
return dataSchemes.size();
|
||||
}
|
||||
|
||||
public String getDataScheme(int index) {
|
||||
return dataSchemes.get(index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.PatternMatcher;
|
||||
import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Base64;
|
||||
import android.util.DisplayMetrics;
|
||||
@@ -2247,6 +2248,10 @@ public class PackageParser {
|
||||
XmlUtils.skipCurrentTag(parser);
|
||||
outInfo.addCategory(value);
|
||||
} else if (nodeName.equals("data")) {
|
||||
String scheme = parser.getAttributeValue(
|
||||
ANDROID_RESOURCES, "scheme");
|
||||
if (!TextUtils.isEmpty(scheme))
|
||||
outInfo.addDataScheme(scheme);
|
||||
XmlUtils.skipCurrentTag(parser);
|
||||
} else if (!RIGID_PARSER) {
|
||||
Slog.w(TAG, "Unknown element under <intent-filter>: "
|
||||
|
||||
Reference in New Issue
Block a user