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
API stubs and fixes for composeUI
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
|
||||
package android.content.pm;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import android.annotation.SdkConstant;
|
||||
import android.annotation.SdkConstant.SdkConstantType;
|
||||
import android.content.ComponentName;
|
||||
@@ -23,6 +29,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.IntentSender;
|
||||
import android.content.pm.PackageParser.Service;
|
||||
import android.content.pm.PackageParser.ServiceIntentInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -32,11 +40,6 @@ import android.os.UserHandle;
|
||||
import android.util.AndroidException;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Slog;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
class IPackageInstallObserver {}
|
||||
class VerificationParams {}
|
||||
@@ -2321,7 +2324,17 @@ public class PackageManager {
|
||||
*/
|
||||
public List<ResolveInfo> queryIntentServices(Intent intent,
|
||||
int flags) {
|
||||
return new ArrayList<ResolveInfo>();
|
||||
List<ResolveInfo> list = new ArrayList<ResolveInfo>(1);
|
||||
for (Service s: Context.pkg.services) {
|
||||
for (ServiceIntentInfo intentinfo: s.intents) {
|
||||
if (s.getComponentName().equals(intent.getComponent()) || intentinfo.matchAction(intent.getAction())) {
|
||||
ResolveInfo ri = new ResolveInfo();
|
||||
ri.serviceInfo = s.info;
|
||||
list.add(ri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3031,7 +3031,20 @@ public class PackageParser {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parser.getName().equals("meta-data")) {
|
||||
if (parser.getName().equals("intent-filter")) {
|
||||
ServiceIntentInfo intent = new ServiceIntentInfo(s);
|
||||
if (!parseIntent(res, parser, attrs, true /*allowGlobs*/, true /*allowAutoVerify*/,
|
||||
intent, outError)) {
|
||||
return null;
|
||||
}
|
||||
if (intent.countActions() == 0) {
|
||||
Slog.w(TAG, "No actions in intent filter at "
|
||||
+ mArchiveSourcePath + " "
|
||||
+ parser.getPositionDescription());
|
||||
} else {
|
||||
s.intents.add(intent);
|
||||
}
|
||||
} else if (parser.getName().equals("meta-data")) {
|
||||
if ((s.metaData = parseMetaData(res, parser, attrs, s.metaData,
|
||||
outError)) == null) {
|
||||
return null;
|
||||
|
||||
@@ -2,6 +2,7 @@ package android.content.pm;
|
||||
|
||||
public class ResolveInfo {
|
||||
public ActivityInfo activityInfo = new ActivityInfo();
|
||||
public ServiceInfo serviceInfo = new ServiceInfo();
|
||||
|
||||
public static class DisplayNameComparator {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user