Methods Summary |
---|
public void | addCookie(java.lang.Object o, java.lang.Object cookie)
mViewKeyHelpMap.put(o, cookie);
|
public void | addViewKey(android.view.View view, java.lang.Object viewKey)
mViewKeyMap.put(view, viewKey);
|
public boolean | bindService(android.content.Intent arg0, android.content.ServiceConnection arg1, int arg2)
// pass
return false;
|
public int | checkCallingOrSelfPermission(java.lang.String arg0)
// pass
return 0;
|
public int | checkCallingOrSelfUriPermission(android.net.Uri arg0, int arg1)
// pass
return 0;
|
public int | checkCallingPermission(java.lang.String arg0)
// pass
return 0;
|
public int | checkCallingUriPermission(android.net.Uri arg0, int arg1)
// pass
return 0;
|
public int | checkPermission(java.lang.String arg0, int arg1, int arg2)
// pass
return 0;
|
public int | checkPermission(java.lang.String arg0, int arg1, int arg2, android.os.IBinder arg3)
// pass
return 0;
|
public int | checkUriPermission(android.net.Uri arg0, int arg1, int arg2, int arg3)
// pass
return 0;
|
public int | checkUriPermission(android.net.Uri arg0, int arg1, int arg2, int arg3, android.os.IBinder arg4)
// pass
return 0;
|
public int | checkUriPermission(android.net.Uri arg0, java.lang.String arg1, java.lang.String arg2, int arg3, int arg4, int arg5)
// pass
return 0;
|
public void | clearWallpaper()
// pass
|
public android.content.Context | createApplicationContext(android.content.pm.ApplicationInfo application, int flags)
return null;
|
public android.content.Context | createConfigurationContext(android.content.res.Configuration overrideConfiguration)
// pass
return null;
|
public android.content.Context | createDisplayContext(android.view.Display display)
// pass
return null;
|
public android.content.Context | createPackageContext(java.lang.String arg0, int arg1)
// pass
return null;
|
public android.content.Context | createPackageContextAsUser(java.lang.String arg0, int arg1, android.os.UserHandle user)
// pass
return null;
|
private android.content.res.BridgeTypedArray | createStyleBasedTypedArray(com.android.ide.common.rendering.api.StyleResourceValue style, int[] attrs)Creates a {@link BridgeTypedArray} by filling the values defined by the int[] with the
values found in the given style. If no style is specified, the default theme, along with the
styles applied to it are used.
List<Pair<String, Boolean>> attributes = searchAttrs(attrs);
BridgeTypedArray ta = ((BridgeResources) mSystemResources).newTypeArray(attrs.length,
false);
// for each attribute, get its name so that we can search it in the style
for (int i = 0 ; i < attrs.length ; i++) {
Pair<String, Boolean> attribute = attributes.get(i);
if (attribute != null) {
// look for the value in the given style
ResourceValue resValue;
if (style != null) {
resValue = mRenderResources.findItemInStyle(style, attribute.getFirst(),
attribute.getSecond());
} else {
resValue = mRenderResources.findItemInTheme(attribute.getFirst(),
attribute.getSecond());
}
if (resValue != null) {
// resolve it to make sure there are no references left.
ta.bridgeSetValue(i, attribute.getFirst(), attribute.getSecond(),
mRenderResources.resolveResValue(resValue));
}
}
}
ta.sealArray();
return ta;
|
public java.lang.String[] | databaseList()
// pass
return null;
|
public boolean | deleteDatabase(java.lang.String arg0)
// pass
return false;
|
public boolean | deleteFile(java.lang.String arg0)
// pass
return false;
|
public void | disposeResources()Disposes the {@link Resources} singleton.
BridgeResources.disposeSystem();
|
public void | enforceCallingOrSelfPermission(java.lang.String arg0, java.lang.String arg1)
// pass
|
public void | enforceCallingOrSelfUriPermission(android.net.Uri arg0, int arg1, java.lang.String arg2)
// pass
|
public void | enforceCallingPermission(java.lang.String arg0, java.lang.String arg1)
// pass
|
public void | enforceCallingUriPermission(android.net.Uri arg0, int arg1, java.lang.String arg2)
// pass
|
public void | enforcePermission(java.lang.String arg0, int arg1, int arg2, java.lang.String arg3)
// pass
|
public void | enforceUriPermission(android.net.Uri arg0, int arg1, int arg2, int arg3, java.lang.String arg4)
// pass
|
public void | enforceUriPermission(android.net.Uri arg0, java.lang.String arg1, java.lang.String arg2, int arg3, int arg4, int arg5, java.lang.String arg6)
// pass
|
public java.lang.String[] | fileList()
// pass
return null;
|
public android.content.Context | getApplicationContext()
return this;
|
public android.content.pm.ApplicationInfo | getApplicationInfo()
return mApplicationInfo;
|
public android.content.res.AssetManager | getAssets()
// pass
return null;
|
public java.lang.String | getBasePackageName()
// pass
return null;
|
public java.io.File | getCacheDir()
// pass
return null;
|
public java.lang.ClassLoader | getClassLoader()
return this.getClass().getClassLoader();
|
public java.io.File | getCodeCacheDir()
// pass
return null;
|
public android.content.res.Configuration | getConfiguration()
return mConfig;
|
public android.content.ContentResolver | getContentResolver()
if (mContentResolver == null) {
mContentResolver = new BridgeContentResolver(this);
}
return mContentResolver;
|
public java.lang.Object | getCookie(java.lang.Object o)
return mViewKeyHelpMap.get(o);
|
public BridgeXmlBlockParser | getCurrentParser()Returns the current parser at the top the of the stack.
return mParserStack.peek();
|
public java.io.File | getDatabasePath(java.lang.String arg0)
// pass
return null;
|
public java.util.Map | getDefaultPropMap(java.lang.Object key)
return mDefaultPropMaps.get(key);
|
public java.io.File | getDir(java.lang.String arg0, int arg1)
// pass
return null;
|
public android.view.DisplayAdjustments | getDisplayAdjustments(int displayId)
// pass
return null;
|
public int | getDynamicIdByStyle(com.android.ide.common.rendering.api.StyleResourceValue resValue)
if (mDynamicIdToStyleMap == null) {
// create the maps.
mDynamicIdToStyleMap = new HashMap<Integer, StyleResourceValue>();
mStyleToDynamicIdMap = new HashMap<StyleResourceValue, Integer>();
}
// look for an existing id
Integer id = mStyleToDynamicIdMap.get(resValue);
if (id == null) {
// generate a new id
id = ++mDynamicIdGenerator;
// and add it to the maps.
mDynamicIdToStyleMap.put(id, resValue);
mStyleToDynamicIdMap.put(resValue, id);
}
return id;
|
public java.io.File | getExternalCacheDir()
// pass
return null;
|
public java.io.File[] | getExternalCacheDirs()
// pass
return new File[0];
|
public java.io.File | getExternalFilesDir(java.lang.String type)
// pass
return null;
|
public java.io.File[] | getExternalFilesDirs(java.lang.String type)
// pass
return new File[0];
|
public java.io.File[] | getExternalMediaDirs()
// pass
return new File[0];
|
public java.io.File | getFileStreamPath(java.lang.String arg0)
// pass
return null;
|
public java.io.File | getFilesDir()
// pass
return null;
|
public int | getFrameworkResourceValue(com.android.resources.ResourceType resType, java.lang.String resName, int defValue)
if (getRenderResources().getFrameworkResource(resType, resName) != null) {
// Bridge.getResourceId creates a new resource id if an existing one isn't found. So,
// we check for the existence of the resource before calling it.
return Bridge.getResourceId(resType, resName);
}
return defValue;
|
public android.os.Looper | getMainLooper()
return Looper.myLooper();
|
public android.util.DisplayMetrics | getMetrics()
return mMetrics;
|
public java.io.File | getNoBackupFilesDir()
// pass
return null;
|
public java.io.File | getObbDir()
Bridge.getLog().error(LayoutLog.TAG_UNSUPPORTED, "OBB not supported", null);
return null;
|
public java.io.File[] | getObbDirs()
// pass
return new File[0];
|
public java.lang.String | getOpPackageName()
// pass
return null;
|
public java.lang.String | getPackageCodePath()
// pass
return null;
|
public android.content.pm.PackageManager | getPackageManager()
// pass
return null;
|
public java.lang.String | getPackageName()
// pass
return null;
|
public java.lang.String | getPackageResourcePath()
// pass
return null;
|
private com.android.ide.common.rendering.api.ILayoutPullParser | getParser(com.android.ide.common.rendering.api.ResourceReference resource)
ILayoutPullParser parser;
if (resource instanceof ResourceValue) {
parser = mProjectCallback.getParser((ResourceValue) resource);
} else {
parser = mProjectCallback.getParser(resource.getName());
}
return parser;
|
public BridgeXmlBlockParser | getPreviousParser()Returns the previous parser.
if (mParserStack.size() < 2) {
return null;
}
return mParserStack.get(mParserStack.size() - 2);
|
public com.android.ide.common.rendering.api.IProjectCallback | getProjectCallback()
return mProjectCallback;
|
public java.lang.Object | getProjectKey()
return mProjectKey;
|
public int | getProjectResourceValue(com.android.resources.ResourceType resType, java.lang.String resName, int defValue)
// getResourceId creates a new resource id if an existing resource id isn't found. So, we
// check for the existence of the resource before calling it.
if (getRenderResources().getProjectResource(resType, resName) != null) {
if (mProjectCallback != null) {
Integer value = mProjectCallback.getResourceId(resType, resName);
if (value != null) {
return value;
}
}
}
return defValue;
|
public com.android.ide.common.rendering.api.RenderResources | getRenderResources()
return mRenderResources;
|
public android.content.res.Resources | getResources()
return mSystemResources;
|
public android.content.SharedPreferences | getSharedPreferences(java.lang.String arg0, int arg1)
if (mSharedPreferences == null) {
mSharedPreferences = new BridgeSharedPreferences();
}
return mSharedPreferences;
|
public java.io.File | getSharedPrefsFile(java.lang.String name)
// pass
return null;
|
private com.android.ide.common.rendering.api.StyleResourceValue | getStyleByDynamicId(int i)
if (mDynamicIdToStyleMap != null) {
return mDynamicIdToStyleMap.get(i);
}
return null;
|
public java.lang.Object | getSystemService(java.lang.String service)
if (LAYOUT_INFLATER_SERVICE.equals(service)) {
return mBridgeInflater;
}
if (TEXT_SERVICES_MANAGER_SERVICE.equals(service)) {
// we need to return a valid service to avoid NPE
return TextServicesManager.getInstance();
}
if (WINDOW_SERVICE.equals(service)) {
return mWindowManager;
}
// needed by SearchView
if (INPUT_METHOD_SERVICE.equals(service)) {
return null;
}
if (POWER_SERVICE.equals(service)) {
return new PowerManager(this, new BridgePowerManager(), new Handler());
}
if (DISPLAY_SERVICE.equals(service)) {
return mDisplayManager;
}
if (ACCESSIBILITY_SERVICE.equals(service)) {
return AccessibilityManager.getInstance(this);
}
throw new UnsupportedOperationException("Unsupported Service: " + service);
|
public android.content.res.Resources.Theme | getTheme()
return mTheme;
|
public int | getUserId()
return 0; // not used
|
public java.lang.Object | getViewKey(android.view.View view)
return mViewKeyMap.get(view);
|
public android.graphics.drawable.Drawable | getWallpaper()
// pass
return null;
|
public int | getWallpaperDesiredMinimumHeight()
return -1;
|
public int | getWallpaperDesiredMinimumWidth()
return -1;
|
public void | grantUriPermission(java.lang.String arg0, android.net.Uri arg1, int arg2)
// pass
|
public com.android.util.Pair | inflateView(com.android.ide.common.rendering.api.ResourceReference resource, android.view.ViewGroup parent, boolean attachToRoot, boolean skipCallbackParser)
boolean isPlatformLayout = resource.isFramework();
if (!isPlatformLayout && !skipCallbackParser) {
// check if the project callback can provide us with a custom parser.
ILayoutPullParser parser = getParser(resource);
if (parser != null) {
BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(parser,
this, resource.isFramework());
try {
pushParser(blockParser);
return Pair.of(
mBridgeInflater.inflate(blockParser, parent, attachToRoot),
true);
} finally {
popParser();
}
}
}
ResourceValue resValue;
if (resource instanceof ResourceValue) {
resValue = (ResourceValue) resource;
} else {
if (isPlatformLayout) {
resValue = mRenderResources.getFrameworkResource(ResourceType.LAYOUT,
resource.getName());
} else {
resValue = mRenderResources.getProjectResource(ResourceType.LAYOUT,
resource.getName());
}
}
if (resValue != null) {
File xml = new File(resValue.getValue());
if (xml.isFile()) {
// we need to create a pull parser around the layout XML file, and then
// give that to our XmlBlockParser
try {
XmlPullParser parser = ParserFactory.create(xml);
// set the resource ref to have correct view cookies
mBridgeInflater.setResourceReference(resource);
BridgeXmlBlockParser blockParser = new BridgeXmlBlockParser(parser,
this, resource.isFramework());
try {
pushParser(blockParser);
return Pair.of(
mBridgeInflater.inflate(blockParser, parent, attachToRoot),
false);
} finally {
popParser();
}
} catch (XmlPullParserException e) {
Bridge.getLog().error(LayoutLog.TAG_BROKEN,
"Failed to configure parser for " + xml, e, null /*data*/);
// we'll return null below.
} catch (FileNotFoundException e) {
// this shouldn't happen since we check above.
} finally {
mBridgeInflater.setResourceReference(null);
}
} else {
Bridge.getLog().error(LayoutLog.TAG_BROKEN,
String.format("File %s is missing!", xml), null);
}
} else {
Bridge.getLog().error(LayoutLog.TAG_BROKEN,
String.format("Layout %s%s does not exist.", isPlatformLayout ? "android:" : "",
resource.getName()), null);
}
return Pair.of(null, false);
|
public void | initResources()Initializes the {@link Resources} singleton to be linked to this {@link Context}, its
{@link DisplayMetrics}, {@link Configuration}, and {@link IProjectCallback}.
AssetManager assetManager = AssetManager.getSystem();
mSystemResources = BridgeResources.initSystem(
this,
assetManager,
mMetrics,
mConfig,
mProjectCallback);
mTheme = mSystemResources.newTheme();
|
public boolean | isRestricted()
return false;
|
public final android.content.res.BridgeTypedArray | obtainStyledAttributes(int[] attrs)
// No style is specified here, so create the typed array based on the default theme
// and the styles already applied to it. A null value of style indicates that the default
// theme should be used.
return createStyleBasedTypedArray(null, attrs);
|
public final android.content.res.BridgeTypedArray | obtainStyledAttributes(int resid, int[] attrs)
StyleResourceValue style = null;
// get the StyleResourceValue based on the resId;
if (resid != 0) {
style = getStyleByDynamicId(resid);
if (style == null) {
// In some cases, style may not be a dynamic id, so we do a full search.
ResourceReference ref = resolveId(resid);
if (ref != null) {
style = mRenderResources.getStyle(ref.getName(), ref.isFramework());
}
}
if (style == null) {
throw new Resources.NotFoundException();
}
}
if (mTypedArrayCache == null) {
mTypedArrayCache = new HashMap<int[], Map<Integer,BridgeTypedArray>>();
Map<Integer, BridgeTypedArray> map = new HashMap<Integer, BridgeTypedArray>();
mTypedArrayCache.put(attrs, map);
BridgeTypedArray ta = createStyleBasedTypedArray(style, attrs);
map.put(resid, ta);
return ta;
}
// get the 2nd map
Map<Integer, BridgeTypedArray> map = mTypedArrayCache.get(attrs);
if (map == null) {
map = new HashMap<Integer, BridgeTypedArray>();
mTypedArrayCache.put(attrs, map);
}
// get the array from the 2nd map
BridgeTypedArray ta = map.get(resid);
if (ta == null) {
ta = createStyleBasedTypedArray(style, attrs);
map.put(resid, ta);
}
return ta;
|
public final android.content.res.BridgeTypedArray | obtainStyledAttributes(android.util.AttributeSet set, int[] attrs)
return obtainStyledAttributes(set, attrs, 0, 0);
|
public android.content.res.BridgeTypedArray | obtainStyledAttributes(android.util.AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes)
Map<String, String> defaultPropMap = null;
boolean isPlatformFile = true;
// Hint: for XmlPullParser, attach source //DEVICE_SRC/dalvik/libcore/xml/src/java
if (set instanceof BridgeXmlBlockParser) {
BridgeXmlBlockParser parser = null;
parser = (BridgeXmlBlockParser)set;
isPlatformFile = parser.isPlatformFile();
Object key = parser.getViewCookie();
if (key != null) {
defaultPropMap = mDefaultPropMaps.get(key);
if (defaultPropMap == null) {
defaultPropMap = new HashMap<String, String>();
mDefaultPropMaps.put(key, defaultPropMap);
}
}
} else if (set instanceof BridgeLayoutParamsMapAttributes) {
// this is only for temp layout params generated dynamically, so this is never
// platform content.
isPlatformFile = false;
} else if (set != null) { // null parser is ok
// really this should not be happening since its instantiated in Bridge
Bridge.getLog().error(LayoutLog.TAG_BROKEN,
"Parser is not a BridgeXmlBlockParser!", null /*data*/);
return null;
}
List<Pair<String, Boolean>> attributeList = searchAttrs(attrs);
BridgeTypedArray ta = ((BridgeResources) mSystemResources).newTypeArray(attrs.length,
isPlatformFile);
// look for a custom style.
String customStyle = null;
if (set != null) {
customStyle = set.getAttributeValue(null /* namespace*/, "style");
}
StyleResourceValue customStyleValues = null;
if (customStyle != null) {
ResourceValue item = mRenderResources.findResValue(customStyle,
isPlatformFile /*forceFrameworkOnly*/);
// resolve it in case it links to something else
item = mRenderResources.resolveResValue(item);
if (item instanceof StyleResourceValue) {
customStyleValues = (StyleResourceValue)item;
}
}
// resolve the defStyleAttr value into a IStyleResourceValue
StyleResourceValue defStyleValues = null;
if (defStyleAttr != 0) {
// get the name from the int.
Pair<String, Boolean> defStyleAttribute = searchAttr(defStyleAttr);
if (defaultPropMap != null) {
String defStyleName = defStyleAttribute.getFirst();
if (defStyleAttribute.getSecond()) {
defStyleName = "android:" + defStyleName;
}
defaultPropMap.put("style", defStyleName);
}
// look for the style in the current theme, and its parent:
ResourceValue item = mRenderResources.findItemInTheme(defStyleAttribute.getFirst(),
defStyleAttribute.getSecond());
if (item != null) {
// item is a reference to a style entry. Search for it.
item = mRenderResources.findResValue(item.getValue(), item.isFramework());
if (item instanceof StyleResourceValue) {
defStyleValues = (StyleResourceValue)item;
}
} else {
Bridge.getLog().error(LayoutLog.TAG_RESOURCES_RESOLVE_THEME_ATTR,
String.format(
"Failed to find style '%s' in current theme",
defStyleAttribute.getFirst()),
null /*data*/);
}
} else if (defStyleRes != 0) {
boolean isFrameworkRes = true;
Pair<ResourceType, String> value = Bridge.resolveResourceId(defStyleRes);
if (value == null) {
value = mProjectCallback.resolveResourceId(defStyleRes);
isFrameworkRes = false;
}
if (value != null) {
if ((value.getFirst() == ResourceType.STYLE)) {
// look for the style in all resources:
StyleResourceValue item = mRenderResources.getStyle(value.getSecond(),
isFrameworkRes);
if (item != null) {
if (defaultPropMap != null) {
defaultPropMap.put("style", item.getName());
}
defStyleValues = item;
} else {
Bridge.getLog().error(null,
String.format(
"Style with id 0x%x (resolved to '%s') does not exist.",
defStyleRes, value.getSecond()),
null);
}
} else {
Bridge.getLog().error(null,
String.format(
"Resource id 0x%x is not of type STYLE (instead %s)",
defStyleRes, value.getFirst().toString()),
null);
}
} else {
Bridge.getLog().error(null,
String.format(
"Failed to find style with id 0x%x in current theme",
defStyleRes),
null);
}
}
String appNamespace = mProjectCallback.getNamespace();
if (attributeList != null) {
for (int index = 0 ; index < attributeList.size() ; index++) {
Pair<String, Boolean> attribute = attributeList.get(index);
if (attribute == null) {
continue;
}
String attrName = attribute.getFirst();
boolean frameworkAttr = attribute.getSecond();
String value = null;
if (set != null) {
value = set.getAttributeValue(
frameworkAttr ? BridgeConstants.NS_RESOURCES : appNamespace,
attrName);
// if this is an app attribute, and the first get fails, try with the
// new res-auto namespace as well
if (!frameworkAttr && value == null) {
value = set.getAttributeValue(BridgeConstants.NS_APP_RES_AUTO, attrName);
}
}
// 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) {
ResourceValue resValue = null;
// look for the value in the custom style first (and its parent if needed)
if (customStyleValues != null) {
resValue = mRenderResources.findItemInStyle(customStyleValues,
attrName, frameworkAttr);
}
// then look for the value in the default Style (and its parent if needed)
if (resValue == null && defStyleValues != null) {
resValue = mRenderResources.findItemInStyle(defStyleValues,
attrName, frameworkAttr);
}
// if the item is not present in the defStyle, we look in the main theme (and
// its parent themes)
if (resValue == null) {
resValue = mRenderResources.findItemInTheme(attrName, frameworkAttr);
}
// if we found a value, we make sure this doesn't reference another value.
// So we resolve it.
if (resValue != null) {
// put the first default value, before the resolution.
if (defaultPropMap != null) {
defaultPropMap.put(attrName, resValue.getValue());
}
resValue = mRenderResources.resolveResValue(resValue);
}
ta.bridgeSetValue(index, attrName, frameworkAttr, 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, attrName, frameworkAttr,
mRenderResources.resolveValue(null, attrName, value, isPlatformFile));
}
}
}
ta.sealArray();
return ta;
|
public java.io.FileInputStream | openFileInput(java.lang.String arg0)
// pass
return null;
|
public java.io.FileOutputStream | openFileOutput(java.lang.String arg0, int arg1)
// pass
return null;
|
public android.database.sqlite.SQLiteDatabase | openOrCreateDatabase(java.lang.String arg0, int arg1, android.database.sqlite.SQLiteDatabase.CursorFactory arg2)
// pass
return null;
|
public android.database.sqlite.SQLiteDatabase | openOrCreateDatabase(java.lang.String arg0, int arg1, android.database.sqlite.SQLiteDatabase.CursorFactory arg2, android.database.DatabaseErrorHandler arg3)
// pass
return null;
|
public android.graphics.drawable.Drawable | peekWallpaper()
// pass
return null;
|
public void | popParser()Removes the parser at the top of the stack
BridgeXmlBlockParser parser = mParserStack.pop();
if (ParserFactory.LOG_PARSER) {
System.out.println("POPD " + parser.getParser().toString());
}
|
public void | pushParser(BridgeXmlBlockParser parser)Adds a parser to the stack.
if (ParserFactory.LOG_PARSER) {
System.out.println("PUSH " + parser.getParser().toString());
}
mParserStack.push(parser);
|
public android.content.Intent | registerReceiver(android.content.BroadcastReceiver arg0, android.content.IntentFilter arg1)
// pass
return null;
|
public android.content.Intent | registerReceiver(android.content.BroadcastReceiver arg0, android.content.IntentFilter arg1, java.lang.String arg2, android.os.Handler arg3)
// pass
return null;
|
public android.content.Intent | registerReceiverAsUser(android.content.BroadcastReceiver arg0, android.os.UserHandle arg0p5, android.content.IntentFilter arg1, java.lang.String arg2, android.os.Handler arg3)
// pass
return null;
|
public void | removeStickyBroadcast(android.content.Intent arg0)
// pass
|
public void | removeStickyBroadcastAsUser(android.content.Intent intent, android.os.UserHandle user)
// pass
|
public com.android.ide.common.rendering.api.ResourceReference | resolveId(int id)
// first get the String related to this id in the framework
Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(id);
if (resourceInfo != null) {
return new ResourceReference(resourceInfo.getSecond(), true);
}
// didn't find a match in the framework? look in the project.
if (mProjectCallback != null) {
resourceInfo = mProjectCallback.resolveResourceId(id);
if (resourceInfo != null) {
return new ResourceReference(resourceInfo.getSecond(), false);
}
}
// The base value for R.style is 0x01030000 and the custom style is 0x02030000.
// So, if the second byte is 03, it's probably a style.
if ((id >> 16 & 0xFF) == 0x03) {
return getStyleByDynamicId(id);
}
return null;
|
public boolean | resolveThemeAttribute(int resid, android.util.TypedValue outValue, boolean resolveRefs)
Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(resid);
boolean isFrameworkRes = true;
if (resourceInfo == null) {
resourceInfo = mProjectCallback.resolveResourceId(resid);
isFrameworkRes = false;
}
if (resourceInfo == null) {
return false;
}
ResourceValue value = mRenderResources.findItemInTheme(resourceInfo.getSecond(),
isFrameworkRes);
if (resolveRefs) {
value = mRenderResources.resolveResValue(value);
}
if (value == null) {
// unable to find the attribute.
return false;
}
// check if this is a style resource
if (value instanceof StyleResourceValue) {
// get the id that will represent this style.
outValue.resourceId = getDynamicIdByStyle((StyleResourceValue)value);
return true;
}
int a;
// if this is a framework value.
if (value.isFramework()) {
// look for idName in the android R classes.
// use 0 a default res value as it's not a valid id value.
a = getFrameworkResourceValue(value.getResourceType(), value.getName(), 0 /*defValue*/);
} else {
// look for idName in the project R class.
// use 0 a default res value as it's not a valid id value.
a = getProjectResourceValue(value.getResourceType(), value.getName(), 0 /*defValue*/);
}
if (a != 0) {
outValue.resourceId = a;
return true;
}
return false;
|
public void | revokeUriPermission(android.net.Uri arg0, int arg1)
// pass
|
public com.android.util.Pair | searchAttr(int attr)Searches for the attribute referenced by its internal id.
Pair<ResourceType, String> info = Bridge.resolveResourceId(attr);
if (info != null) {
return Pair.of(info.getSecond(), Boolean.TRUE);
}
info = mProjectCallback.resolveResourceId(attr);
if (info != null) {
return Pair.of(info.getSecond(), Boolean.FALSE);
}
return null;
|
private java.util.List | searchAttrs(int[] attrs)The input int[] attrs is a list of attributes. The returns a list of information about
each attributes. The information is (name, isFramework)
List<Pair<String, Boolean>> results = new ArrayList<Pair<String, Boolean>>(attrs.length);
// for each attribute, get its name so that we can search it in the style
for (int attr : attrs) {
Pair<ResourceType, String> resolvedResource = Bridge.resolveResourceId(attr);
boolean isFramework = false;
if (resolvedResource != null) {
isFramework = true;
} else {
resolvedResource = mProjectCallback.resolveResourceId(attr);
}
if (resolvedResource != null) {
results.add(Pair.of(resolvedResource.getSecond(), isFramework));
} else {
results.add(null);
}
}
return results;
|
public void | sendBroadcast(android.content.Intent arg0)
// pass
|
public void | sendBroadcast(android.content.Intent arg0, java.lang.String arg1)
// pass
|
public void | sendBroadcast(android.content.Intent intent, java.lang.String receiverPermission, int appOp)
// pass
|
public void | sendBroadcastAsUser(android.content.Intent intent, android.os.UserHandle user)
// pass
|
public void | sendBroadcastAsUser(android.content.Intent intent, android.os.UserHandle user, java.lang.String receiverPermission)
// pass
|
public void | sendOrderedBroadcast(android.content.Intent arg0, java.lang.String arg1)
// pass
|
public void | sendOrderedBroadcast(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)
// pass
|
public void | sendOrderedBroadcast(android.content.Intent intent, java.lang.String receiverPermission, int appOp, android.content.BroadcastReceiver resultReceiver, android.os.Handler scheduler, int initialCode, java.lang.String initialData, android.os.Bundle initialExtras)
// pass
|
public void | sendOrderedBroadcastAsUser(android.content.Intent intent, android.os.UserHandle user, java.lang.String receiverPermission, android.content.BroadcastReceiver resultReceiver, android.os.Handler scheduler, int initialCode, java.lang.String initialData, android.os.Bundle initialExtras)
// pass
|
public void | sendOrderedBroadcastAsUser(android.content.Intent intent, android.os.UserHandle user, java.lang.String receiverPermission, int appOp, android.content.BroadcastReceiver resultReceiver, android.os.Handler scheduler, int initialCode, java.lang.String initialData, android.os.Bundle initialExtras)
// pass
|
public void | sendStickyBroadcast(android.content.Intent arg0)
// pass
|
public void | sendStickyBroadcastAsUser(android.content.Intent intent, android.os.UserHandle user)
// pass
|
public void | sendStickyOrderedBroadcast(android.content.Intent intent, android.content.BroadcastReceiver resultReceiver, android.os.Handler scheduler, int initialCode, java.lang.String initialData, android.os.Bundle initialExtras)
// pass
|
public void | sendStickyOrderedBroadcastAsUser(android.content.Intent intent, android.os.UserHandle user, android.content.BroadcastReceiver resultReceiver, android.os.Handler scheduler, int initialCode, java.lang.String initialData, android.os.Bundle initialExtras)
// pass
|
public void | setBridgeInflater(android.view.BridgeInflater inflater)
mBridgeInflater = inflater;
|
public void | setTheme(int arg0)
// pass
|
public void | setWallpaper(android.graphics.Bitmap arg0)
// pass
|
public void | setWallpaper(java.io.InputStream arg0)
// pass
|
public void | startActivities(android.content.Intent[] arg0)
// pass
|
public void | startActivities(android.content.Intent[] arg0, android.os.Bundle arg1)
// pass
|
public void | startActivity(android.content.Intent arg0)
// pass
|
public void | startActivity(android.content.Intent arg0, android.os.Bundle arg1)
// pass
|
public boolean | startInstrumentation(android.content.ComponentName arg0, java.lang.String arg1, android.os.Bundle arg2)
// pass
return false;
|
public void | startIntentSender(android.content.IntentSender intent, android.content.Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags)
// pass
|
public void | startIntentSender(android.content.IntentSender intent, android.content.Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, android.os.Bundle options)
// pass
|
public android.content.ComponentName | startService(android.content.Intent arg0)
// pass
return null;
|
public android.content.ComponentName | startServiceAsUser(android.content.Intent arg0, android.os.UserHandle arg1)
// pass
return null;
|
public boolean | stopService(android.content.Intent arg0)
// pass
return false;
|
public boolean | stopServiceAsUser(android.content.Intent arg0, android.os.UserHandle arg1)
// pass
return false;
|
public void | unbindService(android.content.ServiceConnection arg0)
// pass
|
public void | unregisterReceiver(android.content.BroadcastReceiver arg0)
// pass
|