am 94ff3f1f: Merge change 21063 into donut

Merge commit '94ff3f1f08805b68c5524b39024968aebcdc83ee' into eclair

* commit '94ff3f1f08805b68c5524b39024968aebcdc83ee':
  Fix handling of reference XML file in layout files
This commit is contained in:
Xavier Ducrohet
2009-08-13 18:43:54 -07:00
committed by Android Git Automerger
3 changed files with 82 additions and 46 deletions

View File

@ -53,6 +53,8 @@ public final class ServiceManager {
* Return a list of all currently running services. * Return a list of all currently running services.
*/ */
public static String[] listServices() throws RemoteException { public static String[] listServices() throws RemoteException {
// actual implementation returns null sometimes, so it's ok
// to return null instead of an empty list.
return null; return null;
} }

View File

@ -87,6 +87,8 @@ public final class AccessibilityManager {
* @return An unmodifiable list with {@link ServiceInfo}s. * @return An unmodifiable list with {@link ServiceInfo}s.
*/ */
public List<ServiceInfo> getAccessibilityServiceList() { public List<ServiceInfo> getAccessibilityServiceList() {
// normal implementation does this in some case, so let's do the same
// (unmodifiableList wrapped around null).
List<ServiceInfo> services = null; List<ServiceInfo> services = null;
return Collections.unmodifiableList(services); return Collections.unmodifiableList(services);
} }

View File

@ -385,6 +385,11 @@ public final class BridgeResources extends Resources {
if (ResourceHelper.stringToFloat(v, outValue)) { if (ResourceHelper.stringToFloat(v, outValue)) {
return; return;
} }
// else it's a string
outValue.type = TypedValue.TYPE_STRING;
outValue.string = v;
return;
} }
} }
@ -435,6 +440,33 @@ public final class BridgeResources extends Resources {
return null; return null;
} }
@Override
public XmlResourceParser loadXmlResourceParser(String file, int id,
int assetCookie, String type) throws NotFoundException {
// even though we know the XML file to load directly, we still need to resolve the
// id so that we can know if it's a platform or project resource.
// (mPlatformResouceFlag will get the result and will be used later).
getResourceValue(id, mPlatformResourceFlag);
File f = new File(file);
try {
KXmlParser parser = new KXmlParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
parser.setInput(new FileReader(f));
return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
} catch (XmlPullParserException e) {
NotFoundException newE = new NotFoundException();
newE.initCause(e);
throw newE;
} catch (FileNotFoundException e) {
NotFoundException newE = new NotFoundException();
newE.initCause(e);
throw newE;
}
}
@Override @Override
public InputStream openRawResource(int id) throws NotFoundException { public InputStream openRawResource(int id) throws NotFoundException {
IResourceValue value = getResourceValue(id, mPlatformResourceFlag); IResourceValue value = getResourceValue(id, mPlatformResourceFlag);