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

Commit 51391666 authored by Sungsoo Lim's avatar Sungsoo Lim Committed by Android (Google) Code Review
Browse files

Merge "Replace ComponentName to InputId."

parents 46897108 d6672b51
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -29179,11 +29179,11 @@ package android.tv {
  }
  public final class TvInputManager {
    method public void createSession(android.content.ComponentName, android.tv.TvInputManager.SessionCreateCallback, android.os.Handler);
    method public boolean getAvailability(android.content.ComponentName);
    method public void createSession(java.lang.String, android.tv.TvInputManager.SessionCreateCallback, android.os.Handler);
    method public boolean getAvailability(java.lang.String);
    method public java.util.List<android.tv.TvInputInfo> getTvInputList();
    method public void registerListener(android.content.ComponentName, android.tv.TvInputManager.TvInputListener, android.os.Handler);
    method public void unregisterListener(android.content.ComponentName, android.tv.TvInputManager.TvInputListener);
    method public void registerListener(java.lang.String, android.tv.TvInputManager.TvInputListener, android.os.Handler);
    method public void unregisterListener(java.lang.String, android.tv.TvInputManager.TvInputListener);
  }
  public static final class TvInputManager.Session {
@@ -29198,7 +29198,7 @@ package android.tv {
  public static abstract class TvInputManager.TvInputListener {
    ctor public TvInputManager.TvInputListener();
    method public void onAvailabilityChanged(android.content.ComponentName, boolean);
    method public void onAvailabilityChanged(java.lang.String, boolean);
  }
  public abstract class TvInputService extends android.app.Service {
@@ -29230,7 +29230,7 @@ package android.tv {
    ctor public TvView(android.content.Context);
    ctor public TvView(android.content.Context, android.util.AttributeSet);
    ctor public TvView(android.content.Context, android.util.AttributeSet, int);
    method public void bindTvInput(android.content.ComponentName, android.tv.TvInputManager.SessionCreateCallback);
    method public void bindTvInput(java.lang.String, android.tv.TvInputManager.SessionCreateCallback);
    method public boolean dispatchUnhandledInputEvent(android.view.InputEvent);
    method public boolean onUnhandledInputEvent(android.view.InputEvent);
    method public void setOnUnhandledInputEventListener(android.tv.TvView.OnUnhandledInputEventListener);
+2 −2
Original line number Diff line number Diff line
@@ -26,6 +26,6 @@ import android.view.InputChannel;
 * @hide
 */
oneway interface ITvInputClient {
    void onSessionCreated(in ComponentName name, IBinder token, in InputChannel channel, int seq);
    void onAvailabilityChanged(in ComponentName name, boolean isAvailable);
    void onSessionCreated(in String inputId, IBinder token, in InputChannel channel, int seq);
    void onAvailabilityChanged(in String inputId, boolean isAvailable);
}
+4 −4
Original line number Diff line number Diff line
@@ -30,12 +30,12 @@ import android.view.Surface;
interface ITvInputManager {
    List<TvInputInfo> getTvInputList(int userId);

    boolean getAvailability(in ITvInputClient client, in ComponentName name, int userId);
    boolean getAvailability(in ITvInputClient client, in String inputId, int userId);

    void registerCallback(in ITvInputClient client, in ComponentName name, int userId);
    void unregisterCallback(in ITvInputClient client, in ComponentName name, int userId);
    void registerCallback(in ITvInputClient client, in String inputId, int userId);
    void unregisterCallback(in ITvInputClient client, in String inputId, int userId);

    void createSession(in ITvInputClient client, in ComponentName name, int seq, int userId);
    void createSession(in ITvInputClient client, in String inputId, int seq, int userId);
    void releaseSession(in IBinder sessionToken, int userId);

    void setSurface(in IBinder sessionToken, in Surface surface, int userId);
+1 −1
Original line number Diff line number Diff line
@@ -24,5 +24,5 @@ import android.content.ComponentName;
 * @hide
 */
oneway interface ITvInputServiceCallback {
    void onAvailabilityChanged(in ComponentName name, boolean isAvailable);
    void onAvailabilityChanged(in String inputId, boolean isAvailable);
}
+13 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public final class TvInputInfo implements Parcelable {
    public TvInputInfo(ResolveInfo service) {
        mService = service;
        ServiceInfo si = service.serviceInfo;
        mId = new ComponentName(si.packageName, si.name).flattenToShortString();
        mId = generateInputIdForComponenetName(new ComponentName(si.packageName, si.name));
    }

    /**
@@ -75,7 +75,7 @@ public final class TvInputInfo implements Parcelable {
     * Loads the user-displayed label for this TV input service.
     *
     * @param pm Supplies a PackageManager used to load the TV input's resources.
     * @return Returns a CharSequence containing the TV input's label. If the TV input does not have
     * @return a CharSequence containing the TV input's label. If the TV input does not have
     *         a label, its name is returned.
     */
    public CharSequence loadLabel(PackageManager pm) {
@@ -127,6 +127,17 @@ public final class TvInputInfo implements Parcelable {
        mService.writeToParcel(dest, flags);
    }

    /**
     * Used to generate an input id from a ComponentName.
     *
     * @param name the component name for generating an input id.
     * @return the generated input id for the given {@code name}.
     * @hide
     */
    public static final String generateInputIdForComponenetName(ComponentName name) {
        return name.flattenToShortString();
    }

    /**
     * Used to make this class parcelable.
     *
Loading