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

Commit 2a4136b9 authored by Yabin Huang's avatar Yabin Huang
Browse files

Replace test API with public API

Context#getUserId() and Context#getDisplayId() are test APIs and can't
be used by non-testing app. So this CL replaced them with public APIs.

Fixes: 339096449
Test: atest ConcurrentMultiSessionImeTest
Change-Id: I361066487fbf7551dd99aa32baebec9e73ce34f6
parent 11871ce2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static com.android.server.inputmethod.multisessiontest.TestRequestConstan

import android.app.Activity;
import android.os.Bundle;
import android.os.Process;
import android.util.Log;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
@@ -47,8 +48,9 @@ public final class MainActivity extends ConcurrentUserActivityBase {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.v(TAG, "Create MainActivity as user " + getUserId() + " on display "
                + getDisplayId());
        Log.v(TAG, "Create MainActivity as user "
                + Process.myUserHandle().getIdentifier() + " on display "
                + getDisplay().getDisplayId());
        setContentView(R.layout.main_activity);
        mImm = getSystemService(InputMethodManager.class);
        mEditor = requireViewById(R.id.edit_text);