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

Commit 010bed74 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 23723 into eclair

* changes:
  Get drawable directory for the platform buttons.
parents 23db1731 83031581
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -112,8 +112,6 @@ class BrowserFrame extends Handler {
            // create PluginManager with current Context
            PluginManager.getInstance(context);
        }
        AssetManager am = context.getAssets();
        nativeCreateFrame(w, am, proxy.getBackForwardList());

        mSettings = settings;
        mContext = context;
@@ -121,6 +119,9 @@ class BrowserFrame extends Handler {
        mDatabase = WebViewDatabase.getInstance(context);
        mWebViewCore = w;

        AssetManager am = context.getAssets();
        nativeCreateFrame(w, am, proxy.getBackForwardList());

        if (DebugFlags.BROWSER_FRAME) {
            Log.v(LOGTAG, "BrowserFrame constructor: this=" + this);
        }
@@ -670,6 +671,7 @@ class BrowserFrame extends Handler {
    // these ids need to be in sync with enum RAW_RES_ID in WebFrame
    private static final int NODOMAIN = 1;
    private static final int LOADERROR = 2;
    private static final int DRAWABLEDIR = 3;

    String getRawResFilename(int id) {
        int resid;
@@ -682,12 +684,26 @@ class BrowserFrame extends Handler {
                resid = com.android.internal.R.raw.loaderror;
                break;

            case DRAWABLEDIR:
                // use one known resource to find the drawable directory
                resid = com.android.internal.R.drawable.btn_check_off;
                break;

            default:
                Log.e(LOGTAG, "getRawResFilename got incompatible resource ID");
                return "";
        }
        TypedValue value = new TypedValue();
        mContext.getResources().getValue(resid, value, true);
        if (id == DRAWABLEDIR) {
            String path = value.string.toString();
            int index = path.lastIndexOf('/');
            if (index < 0) {
                Log.e(LOGTAG, "Can't find drawable directory.");
                return "";
            }
            return path.substring(0, index + 1);
        }
        return value.string.toString();
    }