title: Random crash on InputConnectionWrapper
body: <pre><code>ArrayList&lt;HashMap&lt;String, Object&gt;&gt; itemList;    
  btnSelectWiFi.setOnClickListener(v -&gt; {
      try {
          AlertDialog.Builder builder = new AlertDialog.Builder(activity);
          builder.setTitle(&quot;WiFi&quot;);
          ListView list = new ListView(activity);
          list.setAdapter(new CustomListAdapter(activity));
          list.setOnItemClickListener((arg0, arg1, position, arg3) -&gt; {
              if (dialog.isShowing()) {
                  dialog.dismiss();
                  tvNetworkName.setText((String) itemList.get(position).get(&quot;SSID&quot;));
                  networkName = (String) itemList.get(position).get(&quot;SSID&quot;);
                  wifiSecurity = (String) itemList.get(position).get(&quot;security&quot;);
                  networkSettings.setVisibility(View.VISIBLE);
              }
          });
          builder.setView(list);
          dialog = builder.create();
          dialog.show();
      } catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  <p>Here the code to fill the list of available WiFi connnections:</p>
  <pre><code>public class CustomListAdapter extends BaseAdapter {
      private final LayoutInflater inflater;
  
      public CustomListAdapter(Context context) {
          this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          initListItems();
      }
  
      public void initListItems() {
          itemList = new ArrayList&lt;&gt;();
          List&lt;ScanResult&gt; scanResultsList = new ArrayList&lt;&gt;(); //wifiManager.getConfiguredNetworks();
          List&lt;String&gt; addedSSID = new ArrayList&lt;&gt;();
  
          for (ScanResult result : results) {
              if (!addedSSID.contains(result.SSID) &amp;&amp; (result.SSID != null &amp;&amp; !result.SSID.toLowerCase().contains(&quot;hh-&quot;))) {
                  scanResultsList.add(result);
                  addedSSID.add(result.SSID);
              }
          }
  
          for (ScanResult scanResult : scanResultsList) {
              try {
                  // exclude unnamed wifi
                  if (scanResult.SSID == null || scanResult.SSID.length() == 0)
                      continue;
  
                  HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
                  map.put(&quot;SSID&quot;, scanResult.SSID.replace(&quot;\&quot;&quot;, &quot;&quot;));
                  map.put(&quot;BSSID&quot;, scanResult.BSSID);
                  map.put(&quot;wifiConfiguration&quot;, scanResult);
                  map.put(&quot;selected&quot;, false);
                  itemList.add(map);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
  
      @Override
      public int getCount() {
          return itemList.size();
      }
  
      @Override
      public Object getItem(int arg0) {
          return itemList.get(arg0);
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          MainListHolder mHolder;
  
          View v = convertView;
          if (convertView == null) {
              mHolder = new MainListHolder();
              v = inflater.inflate(R.layout.wifi_entry_item, null);
              mHolder.tvNetworkName = v.findViewById(R.id.networkName);
              v.setTag(mHolder);
          } else {
              mHolder = (MainListHolder) v.getTag();
          }
  
          HashMap&lt;String, Object&gt; item = itemList.get(position);
          mHolder.tvNetworkName.setText((String) item.get(&quot;SSID&quot;));
          return v;
      }
  
      class MainListHolder {
          private TextView tvNetworkName;
      }
  }
  </code></pre>
  <p>when I hit the button in some cases and only for a few Android phone I get this mysterious error:</p>
  <pre><code>2022-01-26 13:12:42.383 E/InputConnectionWrapper: InputConnectionWrapper.waitForInputConnectionFutureInternal():1528 Failed to get the input connection call's result.
      java.util.concurrent.TimeoutException: Waited 100 milliseconds (plus 198307 nanoseconds delay) for lvf@fa860f3[status=PENDING, info=[task=[running=[RUNNING ON ICWrapper-1], hfn@72d81b0]]]
          at lsg.get(PG:50)
          at hfx.h(PG:2)
          at hfx.g(PG:2)
          at nxc.m(PG:6)
          at hgg.C(PG:1)
          at hgg.o(PG:1)
          at hgg.q(PG:5)
          at hfx.b(PG:14)
          at cvz.onUpdateSelection(PG:5)
          at android.inputmethodservice.InputMethodService$InputMethodSessionImpl.updateSelection(InputMethodService.java:1171)
          at android.inputmethodservice.IInputMethodSessionWrapper.executeMessage(IInputMethodSessionWrapper.java:111)
          at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:44)
          at android.os.Handler.dispatchMessage(Handler.java:106)
          at android.os.Looper.loop(Looper.java:246)
          at android.app.ActivityThread.main(ActivityThread.java:8653)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
  2022-01-26 13:12:42.383 W/InputConnectionWrapper: InputConnectionWrapper.recordDuration():1491 IPC IC_GET_SURROUNDING_TEXT took 103 ms
  </code></pre>
  <p>Really, I can't understand this stack trace, any help?</p>
  <p><em><strong>UPDATE</strong></em></p>
  <p>This snippet of code is opening a dialog for selecting a WiFi connection.</p>
  <p>This error occurs only for a specific phone (for now), HUAWEI.</p>