Andrei Litvin 3b92b9682d Add support for GamePad api in ITvRemoteServiceInput.
Gamepad-specific API is a separtate input path from standard "remote"
service. Specifically it adds:
  - openGamepad that creates a virtual input device with
  gamepad-specific suport
  - send gamepad keys
  - send gamepad axis updates, which support joysticks, analog triggers
  and HAT axis (as an alternative to DPAD buttons).

Bug: 150764186

Test: atest media/lib/tvremote/tests/src/com/android/media/tv/remoteprovider/TvRemoteProviderTest.java

Test: flashed a ADT-3 device after the changes. Android TV Remote
      on my phone still worked in controlling the UI.

Merged-In: I49612fce5e74c4e00ca60c715c6c72954e73b7a3
Change-Id: I49612fce5e74c4e00ca60c715c6c72954e73b7a3
(cherry picked from commit 9b9f556af1f53a6ae29d5560240b96fdc151978a)
2020-04-20 10:42:58 -04:00
..

This library (com.android.media.tv.remoteprovider.jar) is a shared java library
containing classes required by unbundled atv remote providers.

--- Rules of this library ---
o This library is effectively a System API for unbundled emote service provider
  that may be distributed outside the system image. So it MUST BE API STABLE.
  You can add but not remove. The rules are the same as for the
  public platform SDK API.
o This library can see and instantiate internal platform classes, but it must not
  expose them in any public method (or by extending them via inheritance). This would
  break clients of the library because they cannot see the internal platform classes.

This library is distributed in the system image, and loaded as
a shared library. So you can change the implementation, but not
the interface. In this way it is like framework.jar.

--- Why does this library exist? ---

Unbundled atv remote providers (such as Emote app) cannot use internal
platform classes.

This library will eventually be replaced when the inputmanager
infrastructure is ready with APIs allowing unbundled system apps to
inject events into uhid.
That API isn't ready yet so this library is a compromise to
make new capabilities available to the system.