FileDocCategorySizeDatePackage
BridgeContext.javaAPI DocAndroid 1.5 API38283Wed May 06 22:42:02 BST 2009com.android.layoutlib.bridge

BridgeContext

public final class BridgeContext extends android.content.Context
Custom implementation of Context to handle non compiled resources.

Fields Summary
private android.content.res.Resources
mResources
private android.content.res.Resources.Theme
mTheme
private HashMap
mViewKeyMap
private com.android.layoutlib.api.IStyleResourceValue
mThemeValues
private final Object
mProjectKey
private Map
mProjectResources
private Map
mFrameworkResources
private Map
mStyleInheritanceMap
private Map
mDynamicIdToStyleMap
private Map
mStyleToDynamicIdMap
private int
mDynamicIdGenerator
private Map
mTypedArrayCache
private android.view.BridgeInflater
mInflater
private final com.android.layoutlib.api.IProjectCallback
mProjectCallback
private final com.android.layoutlib.api.ILayoutLog
mLogger
private BridgeContentResolver
mContentResolver
Constructors Summary
public BridgeContext(Object projectKey, android.util.DisplayMetrics metrics, com.android.layoutlib.api.IStyleResourceValue currentTheme, Map projectResources, Map frameworkResources, Map styleInheritanceMap, com.android.layoutlib.api.IProjectCallback customViewLoader, com.android.layoutlib.api.ILayoutLog logger)

param
projectKey An Object identifying the project. This is used for the cache mechanism.
param
metrics the {@link DisplayMetrics}.
param
themeName The name of the theme to use.
param
projectResources the resources of the project. The map contains (String, map) pairs where the string is the type of the resource reference used in the layout file, and the map contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the value is the resource value.
param
frameworkResources the framework resources. The map contains (String, map) pairs where the string is the type of the resource reference used in the layout file, and the map contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the value is the resource value.
param
styleInheritanceMap
param
customViewLoader


                                                                                                                                           
        
             
               
               
              
                
        mProjectKey = projectKey;
        mProjectCallback = customViewLoader;
        mLogger = logger;
        Configuration config = new Configuration();
        
        AssetManager assetManager = BridgeAssetManager.initSystem();
        mResources = BridgeResources.initSystem(
                this,
                assetManager,
                metrics,
                config,
                customViewLoader);
        
        mTheme = mResources.newTheme();
        
        mThemeValues = currentTheme;
        mProjectResources = projectResources;
        mFrameworkResources = frameworkResources;
        mStyleInheritanceMap = styleInheritanceMap;
    
Methods Summary
public voidaddViewKey(android.view.View view, java.lang.Object viewKey)

        mViewKeyMap.put(view, viewKey);
    
public booleanbindService(android.content.Intent arg0, android.content.ServiceConnection arg1, int arg2)

        // TODO Auto-generated method stub
        return false;
    
public intcheckCallingOrSelfPermission(java.lang.String arg0)

        // TODO Auto-generated method stub
        return 0;
    
public intcheckCallingOrSelfUriPermission(android.net.Uri arg0, int arg1)

        // TODO Auto-generated method stub
        return 0;
    
public intcheckCallingPermission(java.lang.String arg0)

        // TODO Auto-generated method stub
        return 0;
    
public intcheckCallingUriPermission(android.net.Uri arg0, int arg1)

        // TODO Auto-generated method stub
        return 0;
    
public intcheckPermission(java.lang.String arg0, int arg1, int arg2)

        // TODO Auto-generated method stub
        return 0;
    
public intcheckUriPermission(android.net.Uri arg0, int arg1, int arg2, int arg3)

        // TODO Auto-generated method stub
        return 0;
    
public intcheckUriPermission(android.net.Uri arg0, java.lang.String arg1, java.lang.String arg2, int arg3, int arg4, int arg5)

        // TODO Auto-generated method stub
        return 0;
    
public voidclearWallpaper()

        // TODO Auto-generated method stub
        
    
public android.content.ContextcreatePackageContext(java.lang.String arg0, int arg1)

        // TODO Auto-generated method stub
        return null;
    
private BridgeTypedArraycreateStyleBasedTypedArray(com.android.layoutlib.api.IStyleResourceValue style, int[] attrs)
Creates a {@link BridgeTypedArray} by filling the values defined by the int[] with the values found in the given style.

see
#obtainStyledAttributes(int, int[])

        TreeMap<Integer, String> styleNameMap = searchAttrs(attrs, null);
        
        BridgeTypedArray ta = ((BridgeResources) mResources).newTypeArray(attrs.length,
                false /* platformResourceFlag */);
        
        // loop through all the values in the style map, and init the TypedArray with
        // the style we got from the dynamic id
        for (Entry<Integer, String> styleAttribute : styleNameMap.entrySet()) {
            int index = styleAttribute.getKey().intValue();

            String name = styleAttribute.getValue();
            
            // get the value from the style, or its parent styles.
            IResourceValue resValue = findItemInStyle(style, name);
            
            // resolve it to make sure there are no references left.
            ta.bridgeSetValue(index, name, resolveResValue(resValue));
        }
        
        ta.sealArray();

        return ta;
    
public java.lang.String[]databaseList()

        // TODO Auto-generated method stub
        return null;
    
public booleandeleteDatabase(java.lang.String arg0)

        // TODO Auto-generated method stub
        return false;
    
public booleandeleteFile(java.lang.String arg0)

        // TODO Auto-generated method stub
        return false;
    
public voidenforceCallingOrSelfPermission(java.lang.String arg0, java.lang.String arg1)

        // TODO Auto-generated method stub
        
    
public voidenforceCallingOrSelfUriPermission(android.net.Uri arg0, int arg1, java.lang.String arg2)

        // TODO Auto-generated method stub
        
    
public voidenforceCallingPermission(java.lang.String arg0, java.lang.String arg1)

        // TODO Auto-generated method stub
        
    
public voidenforceCallingUriPermission(android.net.Uri arg0, int arg1, java.lang.String arg2)

        // TODO Auto-generated method stub
        
    
public voidenforcePermission(java.lang.String arg0, int arg1, int arg2, java.lang.String arg3)

        // TODO Auto-generated method stub
        
    
public voidenforceUriPermission(android.net.Uri arg0, int arg1, int arg2, int arg3, java.lang.String arg4)

        // TODO Auto-generated method stub
        
    
public voidenforceUriPermission(android.net.Uri arg0, java.lang.String arg1, java.lang.String arg2, int arg3, int arg4, int arg5, java.lang.String arg6)

        // TODO Auto-generated method stub
        
    
public java.lang.String[]fileList()

        // TODO Auto-generated method stub
        return null;
    
com.android.layoutlib.api.IResourceValuefindItemInStyle(com.android.layoutlib.api.IStyleResourceValue style, java.lang.String itemName)
Returns the {@link IResourceValue} matching a given name in a given style. If the item is not directly available in the style, the method looks in its parent style.

param
style the style to search in
param
itemName the name of the item to search for.
return
the {@link IResourceValue} object or null

        IResourceValue item = style.findItem(itemName);
        
        // if we didn't find it, we look in the parent style (if applicable)
        if (item == null && mStyleInheritanceMap != null) {
            IStyleResourceValue parentStyle = mStyleInheritanceMap.get(style);
            if (parentStyle != null) {
                return findItemInStyle(parentStyle, itemName);
            }
        }
        
        return item;
    
com.android.layoutlib.api.IResourceValuefindResValue(java.lang.String reference)
Searches for, and returns a {@link IResourceValue} by its reference.

The reference format can be:

@resType/resName
@android:resType/resName
@resType/android:resName
?resType/resName
?android:resType/resName
?resType/android:resName
Any other string format will return null.

The actual format of a reference is

@[namespace:]resType/resName
but this method only support the android namespace.

param
reference the resource reference to search for.
return
a {@link IResourceValue} or null.

        if (reference == null) {
            return null;
        }
        if (reference.startsWith(BridgeConstants.PREFIX_THEME_REF)) {
            // no theme? no need to go further!
            if (mThemeValues == null) {
                return null;
            }

            boolean frameworkOnly = false;

            // eleminate the prefix from the string
            if (reference.startsWith(BridgeConstants.PREFIX_ANDROID_THEME_REF)) {
                frameworkOnly = true;
                reference = reference.substring(BridgeConstants.PREFIX_ANDROID_THEME_REF.length());
            } else {
                reference = reference.substring(BridgeConstants.PREFIX_THEME_REF.length());
            }

            // at this point, value can contain type/name (drawable/foo for instance).
            // split it to make sure.
            String[] segments = reference.split("\\/");

            // we look for the referenced item name.
            String referenceName = null;
            
            if (segments.length == 2) {
                // there was a resType in the reference. If it's attr, we ignore it
                // else, we assert for now.
                if (BridgeConstants.RES_ATTR.equals(segments[0])) {
                    referenceName = segments[1];
                } else {
                    // At this time, no support for ?type/name where type is not "attr"
                    return null;
                }
            } else {
                // it's just an item name.
                referenceName = segments[0];
            }
            
            // now we look for android: in the referenceName in order to support format
            // such as: ?attr/android:name
            if (referenceName.startsWith(BridgeConstants.PREFIX_ANDROID)) {
                frameworkOnly = true;
                referenceName = referenceName.substring(BridgeConstants.PREFIX_ANDROID.length());
            }

            // Now look for the item in the theme, starting with the current one.
            if (frameworkOnly) {
                // FIXME for now we do the same as if it didn't specify android:
                return findItemInStyle(mThemeValues, referenceName);
            }

            return findItemInStyle(mThemeValues, referenceName);
        } else if (reference.startsWith(BridgeConstants.PREFIX_RESOURCE_REF)) {
            boolean frameworkOnly = false;
            
            // check for the specific null reference value.
            if (BridgeConstants.REFERENCE_NULL.equals(reference)) { 
                return null;
            }

            // Eliminate the prefix from the string.
            if (reference.startsWith(BridgeConstants.PREFIX_ANDROID_RESOURCE_REF)) {
                frameworkOnly = true;
                reference = reference.substring(
                        BridgeConstants.PREFIX_ANDROID_RESOURCE_REF.length());
            } else {
                reference = reference.substring(BridgeConstants.PREFIX_RESOURCE_REF.length());
            }
            
            // at this point, value contains type/[android:]name (drawable/foo for instance)
            String[] segments = reference.split("\\/");
            
            // now we look for android: in the resource name in order to support format
            // such as: @drawable/android:name
            if (segments[1].startsWith(BridgeConstants.PREFIX_ANDROID)) {
                frameworkOnly = true;
                segments[1] = segments[1].substring(BridgeConstants.PREFIX_ANDROID.length());
            }
            
            return findResValue(segments[0], segments[1], frameworkOnly);
        }
        
        // Looks like the value didn't reference anything. Return null.
        return null;
    
private com.android.layoutlib.api.IResourceValuefindResValue(java.lang.String resType, java.lang.String resName, boolean frameworkOnly)
Searches for, and returns a {@link IResourceValue} by its name, and type.

param
resType the type of the resource
param
resName the name of the resource
param
frameworkOnly if true, the method does not search in the project resources

        // map of IResouceValue for the given type
        Map<String, IResourceValue> typeMap;

        // if allowed, search in the project resources first.
        if (frameworkOnly == false) {
            typeMap = mProjectResources.get(resType);
            if (typeMap != null) {
                IResourceValue item = typeMap.get(resName);
                if (item != null) {
                    return item;
                }
            }
        }
        
        // now search in the framework resources.
        typeMap = mFrameworkResources.get(resType);
        if (typeMap != null) {
            IResourceValue item = typeMap.get(resName);
            if (item != null) {
                return item;
            }
        }
        
        // didn't find the resource anywhere.
        return null;
    
public android.content.ContextgetApplicationContext()

        throw new UnsupportedOperationException();
    
public android.content.res.AssetManagergetAssets()

        // TODO Auto-generated method stub
        return null;
    
public java.io.FilegetCacheDir()

        // TODO Auto-generated method stub
        return null;
    
public java.lang.ClassLoadergetClassLoader()

        return this.getClass().getClassLoader();
    
public android.content.ContentResolvergetContentResolver()

        if (mContentResolver == null) {
            mContentResolver = new BridgeContentResolver(this);
        }
        return mContentResolver;
    
public java.io.FilegetDatabasePath(java.lang.String arg0)

        // TODO Auto-generated method stub
        return null;
    
public java.io.FilegetDir(java.lang.String arg0, int arg1)

        // TODO Auto-generated method stub
        return null;
    
intgetDynamicIdByStyle(com.android.layoutlib.api.IStyleResourceValue resValue)

        if (mDynamicIdToStyleMap == null) {
            // create the maps.
            mDynamicIdToStyleMap = new HashMap<Integer, IStyleResourceValue>();
            mStyleToDynamicIdMap = new HashMap<IStyleResourceValue, Integer>();
        }
        
        // look for an existing id
        Integer id = mStyleToDynamicIdMap.get(resValue);
        
        if (id == null) {
            // generate a new id
            id = Integer.valueOf(++mDynamicIdGenerator);
            
            // and add it to the maps.
            mDynamicIdToStyleMap.put(id, resValue);
            mStyleToDynamicIdMap.put(resValue, id);
        }
        
        return id;
    
public java.io.FilegetFileStreamPath(java.lang.String arg0)

        // TODO Auto-generated method stub
        return null;
    
public java.io.FilegetFilesDir()

        // TODO Auto-generated method stub
        return null;
    
intgetFrameworkIdValue(java.lang.String idName, int defValue)

        Integer value = Bridge.getResourceValue(BridgeConstants.RES_ID, idName);
        if (value != null) {
            return value.intValue();
        }
        
        return defValue;
    
public com.android.layoutlib.api.IResourceValuegetFrameworkResource(java.lang.String resourceType, java.lang.String resourceName)
Returns a framework resource by type and name. The returned resource is resolved.

param
resourceType the type of the resource
param
resourceName the name of the resource

        return getResource(resourceType, resourceName, mFrameworkResources);
    
public com.android.layoutlib.api.ILayoutLoggetLogger()

        return mLogger;
    
public android.os.LoopergetMainLooper()

        throw new UnsupportedOperationException();
    
public java.lang.StringgetPackageCodePath()

        // TODO Auto-generated method stub
        return null;
    
public android.content.pm.PackageManagergetPackageManager()

        // TODO Auto-generated method stub
        return null;
    
public java.lang.StringgetPackageName()

        // TODO Auto-generated method stub
        return null;
    
public java.lang.StringgetPackageResourcePath()

        // TODO Auto-generated method stub
        return null;
    
public com.android.layoutlib.api.IProjectCallbackgetProjectCallback()

        return mProjectCallback;
    
intgetProjectIdValue(java.lang.String idName, int defValue)

        if (mProjectCallback != null) {
            Integer value = mProjectCallback.getResourceValue(BridgeConstants.RES_ID, idName);
            if (value != null) {
                return value.intValue();
            }
        }
        
        return defValue;
    
public java.lang.ObjectgetProjectKey()

        return mProjectKey;
    
public com.android.layoutlib.api.IResourceValuegetProjectResource(java.lang.String resourceType, java.lang.String resourceName)
Returns a project resource by type and name. The returned resource is resolved.

param
resourceType the type of the resource
param
resourceName the name of the resource

        return getResource(resourceType, resourceName, mProjectResources);
    
com.android.layoutlib.api.IResourceValuegetResource(java.lang.String resourceType, java.lang.String resourceName, java.util.Map resourceRepository)

        Map<String, IResourceValue> typeMap = resourceRepository.get(resourceType);
        if (typeMap != null) {
            IResourceValue item = typeMap.get(resourceName);
            if (item != null) {
                item = resolveResValue(item);
                return item;
            }
        }
        
        // didn't find the resource anywhere.
        return null;
        
    
public android.content.res.ResourcesgetResources()

        return mResources;
    
public android.content.SharedPreferencesgetSharedPreferences(java.lang.String arg0, int arg1)

        // TODO Auto-generated method stub
        return null;
    
private com.android.layoutlib.api.IStyleResourceValuegetStyleByDynamicId(int i)

        if (mDynamicIdToStyleMap != null) {
            return mDynamicIdToStyleMap.get(i);
        }
   
        return null;
    
public java.lang.ObjectgetSystemService(java.lang.String service)

        if (LAYOUT_INFLATER_SERVICE.equals(service)) {
            return mInflater;
        }
        
        // AutoCompleteTextView and MultiAutoCompleteTextView want a window 
        // service. We don't have any but it's not worth an exception.
        if (WINDOW_SERVICE.equals(service)) {
            return null;
        }

        throw new UnsupportedOperationException("Unsupported Service: " + service);
    
public android.content.res.Resources.ThemegetTheme()

        return mTheme;
    
public java.lang.ObjectgetViewKey(android.view.View view)

        return mViewKeyMap.get(view);
    
public android.graphics.drawable.DrawablegetWallpaper()

        // TODO Auto-generated method stub
        return null;
    
public intgetWallpaperDesiredMinimumHeight()

        return -1;
    
public intgetWallpaperDesiredMinimumWidth()

        return -1;
    
public voidgrantUriPermission(java.lang.String arg0, android.net.Uri arg1, int arg2)

        // TODO Auto-generated method stub
        
    
public final android.content.res.TypedArrayobtainStyledAttributes(int[] attrs)

        return createStyleBasedTypedArray(mThemeValues, attrs);
    
public final android.content.res.TypedArrayobtainStyledAttributes(int resid, int[] attrs)

        // get the IStyleResourceValue based on the resId;
        IStyleResourceValue style = getStyleByDynamicId(resid);
        
        if (style == null) {
            throw new Resources.NotFoundException();
        }

        if (mTypedArrayCache == null) {
            mTypedArrayCache = new HashMap<int[], Map<Integer,TypedArray>>();
            
            Map<Integer, TypedArray> map = new HashMap<Integer, TypedArray>();
            mTypedArrayCache.put(attrs, map);

            BridgeTypedArray ta = createStyleBasedTypedArray(style, attrs);
            map.put(resid, ta);
            
            return ta;
        }
        
        // get the 2nd map
        Map<Integer, TypedArray> map = mTypedArrayCache.get(attrs);
        if (map == null) {
            map = new HashMap<Integer, TypedArray>();
            mTypedArrayCache.put(attrs, map);
        }
        
        // get the array from the 2nd map
        TypedArray ta = map.get(resid);
        
        if (ta == null) {
            ta = createStyleBasedTypedArray(style, attrs);
            map.put(resid, ta);
        }
        
        return ta;
    
public final android.content.res.TypedArrayobtainStyledAttributes(android.util.AttributeSet set, int[] attrs)

        return obtainStyledAttributes(set, attrs, 0, 0);
    
public android.content.res.TypedArrayobtainStyledAttributes(android.util.AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes)

        
        // Hint: for XmlPullParser, attach source //DEVICE_SRC/dalvik/libcore/xml/src/java
        BridgeXmlBlockParser parser = null;
        if (set instanceof BridgeXmlBlockParser) {
            parser = (BridgeXmlBlockParser)set;
        } else {
            // reall this should not be happening since its instantiated in Bridge
            mLogger.error("Parser is not a BridgeXmlBlockParser!");
            return null;
        }

        boolean[] frameworkAttributes = new boolean[1];
        TreeMap<Integer, String> styleNameMap = searchAttrs(attrs, frameworkAttributes);
        
        BridgeTypedArray ta = ((BridgeResources) mResources).newTypeArray(attrs.length,
                parser.isPlatformFile());
        
        // resolve the defStyleAttr value into a IStyleResourceValue
        IStyleResourceValue defStyleValues = null;
        if (defStyleAttr != 0) {
            // get the name from the int.
            String defStyleName = searchAttr(defStyleAttr);

            // look for the style in the current theme, and its parent:
            if (mThemeValues != null) {
                IResourceValue item = findItemInStyle(mThemeValues, defStyleName);
                
                if (item != null) {
                    // item is a reference to a style entry. Search for it.
                    item = findResValue(item.getValue());

                    if (item instanceof IStyleResourceValue) {
                        defStyleValues = (IStyleResourceValue)item;
                    }
                } else {
                    // TODO: log the error properly
                    System.out.println("Failed to find defStyle: " + defStyleName);
                }
            }
        }
        
        if (defStyleRes != 0) {
            // FIXME: See what we need to do with this.
            throw new UnsupportedOperationException();
        }
        
        String namespace = BridgeConstants.NS_RESOURCES;
        if (frameworkAttributes[0] == false) {
            // need to use the application namespace
            namespace = mProjectCallback.getNamespace();
        }

        if (styleNameMap != null) {
            for (Entry<Integer, String> styleAttribute : styleNameMap.entrySet()) {
                int index = styleAttribute.getKey().intValue();
    
                String name = styleAttribute.getValue();
                String value = parser.getAttributeValue(namespace, name);
                
                // if there's no direct value for this attribute in the XML, we look for default
                // values in the widget defStyle, and then in the theme.
                if (value == null) {
                    IResourceValue resValue = null;
    
                    // look for the value in the defStyle first (and its parent if needed)
                    if (defStyleValues != null) {
                        resValue = findItemInStyle(defStyleValues, name);
                    }
                    
                    // if the item is not present in the defStyle, we look in the main theme (and
                    // its parent themes)
                    if (resValue == null && mThemeValues != null) {
                        resValue = findItemInStyle(mThemeValues, name);
                    }
    
                    // if we found a value, we make sure this doesn't reference another value.
                    // So we resolve it.
                    if (resValue != null) {
                        resValue = resolveResValue(resValue);
                    }
                    
                    ta.bridgeSetValue(index, name, resValue);
                } else {
                    // there is a value in the XML, but we need to resolve it in case it's
                    // referencing another resource or a theme value.
                    ta.bridgeSetValue(index, name, resolveValue(null, name, value));
                }
            }
        }
        
        ta.sealArray();
        
        return ta;
    
public java.io.FileInputStreamopenFileInput(java.lang.String arg0)

        // TODO Auto-generated method stub
        return null;
    
public java.io.FileOutputStreamopenFileOutput(java.lang.String arg0, int arg1)

        // TODO Auto-generated method stub
        return null;
    
public android.database.sqlite.SQLiteDatabaseopenOrCreateDatabase(java.lang.String arg0, int arg1, android.database.sqlite.SQLiteDatabase.CursorFactory arg2)

        // TODO Auto-generated method stub
        return null;
    
public android.graphics.drawable.DrawablepeekWallpaper()

        // TODO Auto-generated method stub
        return null;
    
public android.content.IntentregisterReceiver(android.content.BroadcastReceiver arg0, android.content.IntentFilter arg1)

        // TODO Auto-generated method stub
        return null;
    
public android.content.IntentregisterReceiver(android.content.BroadcastReceiver arg0, android.content.IntentFilter arg1, java.lang.String arg2, android.os.Handler arg3)

        // TODO Auto-generated method stub
        return null;
    
public voidremoveStickyBroadcast(android.content.Intent arg0)

        // TODO Auto-generated method stub
        
    
com.android.layoutlib.api.IResourceValueresolveResValue(com.android.layoutlib.api.IResourceValue value)
Returns the {@link IResourceValue} referenced by the value of value.

This method ensures that it returns a {@link IResourceValue} object that does not reference another resource. If the resource cannot be resolved, it returns null.

If a value that does not need to be resolved is given, the method will return the input value.

param
value the value containing the reference to resolve.
return
a {@link IResourceValue} object or null

        if (value == null) {
            return null;
        }
        
        // if the resource value is a style, we simply return it.
        if (value instanceof IStyleResourceValue) {
            return value;
        }

        // else attempt to find another IResourceValue referenced by this one.
        IResourceValue resolvedValue = findResValue(value.getValue());

        // if the value did not reference anything, then we simply return the input value
        if (resolvedValue == null) {
            return value;
        }

        // otherwise, we attempt to resolve this new value as well
        return resolveResValue(resolvedValue);
    
private com.android.layoutlib.api.IResourceValueresolveValue(java.lang.String type, java.lang.String name, java.lang.String value)
Resolves the value of a resource, if the value references a theme or resource value.

This method ensures that it returns a {@link IResourceValue} object that does not reference another resource. If the resource cannot be resolved, it returns null.

If a value that does not need to be resolved is given, the method will return a new instance of IResourceValue that contains the input value.

param
type the type of the resource
param
name the name of the attribute containing this value.
param
value the resource value, or reference to resolve
return
the resolved resource value or null if it failed to resolve it.

        if (value == null) {
            return null;
        }

        // get the IResourceValue referenced by this value
        IResourceValue resValue = findResValue(value);
        
        // if resValue is null, but value is not null, this means it was not a reference.
        // we return the name/value wrapper in a IResourceValue
        if (resValue == null) {
            return new ResourceValue(type, name, value);
        }
        
        // we resolved a first reference, but we need to make sure this isn't a reference also.
        return resolveResValue(resValue);
    
public voidrevokeUriPermission(android.net.Uri arg0, int arg1)

        // TODO Auto-generated method stub
        
    
public java.lang.StringsearchAttr(int attr)
Searches for the attribute referenced by its internal id.

param
attr An attribute reference given to obtainStyledAttributes such as defStyle.
return
The unique name of the attribute, if found, e.g. "buttonStyle". Returns null if nothing is found.

        String[] info = Bridge.resolveResourceValue(attr);
        if (info != null) {
            return info[0];
        }
        
        info = mProjectCallback.resolveResourceValue(attr);
        if (info != null) {
            return info[0];
        }
        
        return null;
    
private java.util.TreeMapsearchAttrs(int[] attrs, boolean[] outFrameworkFlag)
The input int[] attrs is one of com.android.internal.R.styleable fields where the name of the field is the style being referenced and the array contains one index per attribute.

searchAttrs() finds all the names of the attributes referenced so for example if attrs == com.android.internal.R.styleable.View, this returns the list of the "xyz" where there's a field com.android.internal.R.styleable.View_xyz and the field value is the index that is used to reference the attribute later in the TypedArray.

param
attrs An attribute array reference given to obtainStyledAttributes.
return
A sorted map Attribute-Value to Attribute-Name for all attributes declared by the attribute array. Returns null if nothing is found.

        // get the name of the array from the framework resources
        String arrayName = Bridge.resolveResourceValue(attrs);
        if (arrayName != null) {
            // if we found it, get the name of each of the int in the array.
            TreeMap<Integer,String> attributes = new TreeMap<Integer, String>();
            for (int i = 0 ; i < attrs.length ; i++) {
                String[] info = Bridge.resolveResourceValue(attrs[i]);
                if (info != null) {
                    attributes.put(i, info[0]);
                } else {
                    // FIXME Not sure what we should be doing here...
                    attributes.put(i, null);
                }
            }
            
            if (outFrameworkFlag != null) {
                outFrameworkFlag[0] = true;
            }
            
            return attributes;
        }
        
        // if the name was not found in the framework resources, look in the project
        // resources
        arrayName = mProjectCallback.resolveResourceValue(attrs);
        if (arrayName != null) {
            TreeMap<Integer,String> attributes = new TreeMap<Integer, String>();
            for (int i = 0 ; i < attrs.length ; i++) {
                String[] info = mProjectCallback.resolveResourceValue(attrs[i]);
                if (info != null) {
                    attributes.put(i, info[0]);
                } else {
                    // FIXME Not sure what we should be doing here...
                    attributes.put(i, null);
                }
            }

            if (outFrameworkFlag != null) {
                outFrameworkFlag[0] = false;
            }

            return attributes;
        }

        return null;
    
public voidsendBroadcast(android.content.Intent arg0)

        // TODO Auto-generated method stub
        
    
public voidsendBroadcast(android.content.Intent arg0, java.lang.String arg1)

        // TODO Auto-generated method stub
        
    
public voidsendOrderedBroadcast(android.content.Intent arg0, java.lang.String arg1)

        // TODO Auto-generated method stub
        
    
public voidsendOrderedBroadcast(android.content.Intent arg0, java.lang.String arg1, android.content.BroadcastReceiver arg2, android.os.Handler arg3, int arg4, java.lang.String arg5, android.os.Bundle arg6)

        // TODO Auto-generated method stub
        
    
public voidsendStickyBroadcast(android.content.Intent arg0)

        // TODO Auto-generated method stub
        
    
public voidsetBridgeInflater(android.view.BridgeInflater inflater)

        mInflater = inflater;
    
public voidsetTheme(int arg0)

        // TODO Auto-generated method stub
        
    
public voidsetWallpaper(android.graphics.Bitmap arg0)

        // TODO Auto-generated method stub
        
    
public voidsetWallpaper(java.io.InputStream arg0)

        // TODO Auto-generated method stub
        
    
public voidstartActivity(android.content.Intent arg0)

        // TODO Auto-generated method stub
        
    
public booleanstartInstrumentation(android.content.ComponentName arg0, java.lang.String arg1, android.os.Bundle arg2)

        // TODO Auto-generated method stub
        return false;
    
public android.content.ComponentNamestartService(android.content.Intent arg0)

        // TODO Auto-generated method stub
        return null;
    
public booleanstopService(android.content.Intent arg0)

        // TODO Auto-generated method stub
        return false;
    
public voidunbindService(android.content.ServiceConnection arg0)

        // TODO Auto-generated method stub
        
    
public voidunregisterReceiver(android.content.BroadcastReceiver arg0)

        // TODO Auto-generated method stub