Add test API getDisplayId for cts test

Bug: 130379901
Bug: 116349163
Test: atest MultiDisplayClientTests
Change-Id: I6f26c3b5a3abcd82945298e62015ea1259aea954
diff --git a/api/test-current.txt b/api/test-current.txt
index 77c3a94..29ae3d8 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -3389,6 +3389,7 @@
 package android.view.inputmethod {
 
   public final class InputMethodManager {
+    method public int getDisplayId();
     method public boolean isInputMethodPickerShown();
   }
 
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index fd73856..9961191 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -2887,6 +2887,16 @@
         }
     }
 
+    /**
+     * <p>This is used for CTS test only. Do not use this method outside of CTS package.<p/>
+     * @return the ID of this display which this {@link InputMethodManager} resides
+     * @hide
+     */
+    @TestApi
+    public int getDisplayId() {
+        return mDisplayId;
+    }
+
     void doDump(FileDescriptor fd, PrintWriter fout, String[] args) {
         final Printer p = new PrintWriterPrinter(fout);
         p.println("Input method client state for " + this + ":");