Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55434a79 authored by Kenny Root's avatar Kenny Root Committed by Android (Google) Code Review
Browse files

Merge "Multiple asset adding in one shot for AssetManager"

parents 7baf952c 3a198337
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -571,6 +571,26 @@ public final class AssetManager {
     */
    public native final int addAssetPath(String path);

    /**
     * Add multiple sets of assets to the asset manager at once.  See
     * {@link #addAssetPath(String)} for more information.  Returns array of
     * cookies for each added asset with 0 indicating failure, or null if
     * the input array of paths is null.
     * {@hide}
     */
    public final int[] addAssetPaths(String[] paths) {
        if (paths == null) {
            return null;
        }

        int[] cookies = new int[paths.length];
        for (int i = 0; i < paths.length; i++) {
            cookies[i] = addAssetPath(paths[i]);
        }

        return cookies;
    }

    /**
     * Determine whether the state in this asset manager is up-to-date with
     * the files on the filesystem.  If false is returned, you need to