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

Commit 77b66f9f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix drawer title not update to system language"

parents 4d9cd7be 05a566bf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -902,7 +902,7 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On
                throw new UnsupportedOperationException("Unknown mode: " + mode);
        }

        intent.putExtra(DocumentsContract.EXTRA_PROMPT, getResources().getString(drawerTitleId));
        intent.putExtra(DocumentsContract.EXTRA_PROMPT, drawerTitleId);

        // Model must be accessed in UI thread, since underlying cursor is not threadsafe.
        List<DocumentInfo> docs = mModel.getDocuments(selected);
+21 −13
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static com.android.documentsui.base.State.ACTION_OPEN_TREE;
import static com.android.documentsui.base.State.ACTION_PICK_COPY_DESTINATION;

import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
@@ -264,21 +265,28 @@ public class PickActivity extends BaseActivity implements ActionHandler.Addons {

    @Override
    public String getDrawerTitle() {
        String title = getIntent().getStringExtra(DocumentsContract.EXTRA_PROMPT);
        String title;
        try {
            // Internal use case, we will send string id instead of string text.
            title = getResources().getString(
                    getIntent().getIntExtra(DocumentsContract.EXTRA_PROMPT, -1));
        } catch (Resources.NotFoundException e) {
            // 3rd party use case, it should send string text.
            title = getIntent().getStringExtra(DocumentsContract.EXTRA_PROMPT);
            if (title == null) {
            if (mState.action == ACTION_OPEN ||
                mState.action == ACTION_GET_CONTENT ||
                mState.action == ACTION_OPEN_TREE) {
                if (mState.action == ACTION_OPEN
                        || mState.action == ACTION_GET_CONTENT
                        || mState.action == ACTION_OPEN_TREE) {
                    title = getResources().getString(R.string.title_open);
            } else if (mState.action == ACTION_CREATE ||
                       mState.action == ACTION_PICK_COPY_DESTINATION) {
                } else if (mState.action == ACTION_CREATE
                        || mState.action == ACTION_PICK_COPY_DESTINATION) {
                    title = getResources().getString(R.string.title_save);
                } else {
                    // If all else fails, just call it "Documents".
                    title = getResources().getString(R.string.app_label);
                }
            }

        }
        return title;
    }