コード例 #1
0
 /**
  * Add an additional set of assets to the asset manager. This can be either a directory or ZIP
  * file. Not for use by applications. Returns the cookie of the added asset, or 0 on failure.
  * {@hide}
  */
 public final int addAssetPath(String path) {
   synchronized (this) {
     int res = addAssetPathNative(path);
     if (mStringBlocks != null) {
       makeStringBlocks(mStringBlocks);
     }
     return res;
   }
 }
コード例 #2
0
 /*package*/ final void ensureStringBlocks() {
   if (mStringBlocks == null) {
     synchronized (this) {
       if (mStringBlocks == null) {
         makeStringBlocks(sSystem.mStringBlocks);
       }
     }
   }
 }
コード例 #3
0
 private static void ensureSystemAssets() {
   synchronized (sSync) {
     if (sSystem == null) {
       AssetManager system = new AssetManager(true);
       system.makeStringBlocks(null);
       sSystem = system;
     }
   }
 }
コード例 #4
0
 /**
  * Add a set of assets to overlay an already added set of assets.
  *
  * <p>This is only intended for application resources. System wide resources are handled before
  * any Java code is executed.
  *
  * <p>{@hide}
  */
 public final int addOverlayPath(
     String idmapPath,
     String themeApkPath,
     String resApkPath,
     String targetPkgPath,
     String prefixPath) {
   synchronized (this) {
     int res =
         addOverlayPathNative(idmapPath, themeApkPath, resApkPath, targetPkgPath, prefixPath);
     if (mStringBlocks != null) {
       makeStringBlocks(mStringBlocks);
     }
     return res;
   }
 }
コード例 #5
0
 /*package*/ final void recreateStringBlocks() {
   synchronized (this) {
     makeStringBlocks(sSystem.mStringBlocks);
   }
 }