Merge "TIAF API review: rename TvInteractiveAppInfo" into tm-dev am: aaf5caef2f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17115740 Change-Id: Ib33dd6607238552c0d37fc1ee550f4ca9a04cd53
This commit is contained in:
@@ -26105,21 +26105,8 @@ package android.media.tv.interactive {
|
|||||||
method @NonNull public android.media.tv.interactive.AppLinkInfo.Builder setUriScheme(@NonNull String);
|
method @NonNull public android.media.tv.interactive.AppLinkInfo.Builder setUriScheme(@NonNull String);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class TvInteractiveAppInfo implements android.os.Parcelable {
|
|
||||||
ctor public TvInteractiveAppInfo(@NonNull android.content.Context, @NonNull android.content.ComponentName);
|
|
||||||
method public int describeContents();
|
|
||||||
method @NonNull public String getId();
|
|
||||||
method @Nullable public android.content.pm.ServiceInfo getServiceInfo();
|
|
||||||
method @NonNull public int getSupportedTypes();
|
|
||||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.interactive.TvInteractiveAppInfo> CREATOR;
|
|
||||||
field public static final int INTERACTIVE_APP_TYPE_ATSC = 2; // 0x2
|
|
||||||
field public static final int INTERACTIVE_APP_TYPE_GINGA = 4; // 0x4
|
|
||||||
field public static final int INTERACTIVE_APP_TYPE_HBBTV = 1; // 0x1
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class TvInteractiveAppManager {
|
public final class TvInteractiveAppManager {
|
||||||
method @NonNull public java.util.List<android.media.tv.interactive.TvInteractiveAppInfo> getTvInteractiveAppServiceList();
|
method @NonNull public java.util.List<android.media.tv.interactive.TvInteractiveAppServiceInfo> getTvInteractiveAppServiceList();
|
||||||
method public void prepare(@NonNull String, int);
|
method public void prepare(@NonNull String, int);
|
||||||
method public void registerAppLinkInfo(@NonNull String, @NonNull android.media.tv.interactive.AppLinkInfo);
|
method public void registerAppLinkInfo(@NonNull String, @NonNull android.media.tv.interactive.AppLinkInfo);
|
||||||
method public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.interactive.TvInteractiveAppManager.TvInteractiveAppCallback);
|
method public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.interactive.TvInteractiveAppManager.TvInteractiveAppCallback);
|
||||||
@@ -26242,6 +26229,19 @@ package android.media.tv.interactive {
|
|||||||
method @CallSuper public void setVideoBounds(@NonNull android.graphics.Rect);
|
method @CallSuper public void setVideoBounds(@NonNull android.graphics.Rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final class TvInteractiveAppServiceInfo implements android.os.Parcelable {
|
||||||
|
ctor public TvInteractiveAppServiceInfo(@NonNull android.content.Context, @NonNull android.content.ComponentName);
|
||||||
|
method public int describeContents();
|
||||||
|
method @NonNull public String getId();
|
||||||
|
method @Nullable public android.content.pm.ServiceInfo getServiceInfo();
|
||||||
|
method @NonNull public int getSupportedTypes();
|
||||||
|
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||||
|
field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.interactive.TvInteractiveAppServiceInfo> CREATOR;
|
||||||
|
field public static final int INTERACTIVE_APP_TYPE_ATSC = 2; // 0x2
|
||||||
|
field public static final int INTERACTIVE_APP_TYPE_GINGA = 4; // 0x4
|
||||||
|
field public static final int INTERACTIVE_APP_TYPE_HBBTV = 1; // 0x1
|
||||||
|
}
|
||||||
|
|
||||||
public class TvInteractiveAppView extends android.view.ViewGroup {
|
public class TvInteractiveAppView extends android.view.ViewGroup {
|
||||||
ctor public TvInteractiveAppView(@NonNull android.content.Context);
|
ctor public TvInteractiveAppView(@NonNull android.content.Context);
|
||||||
ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
|
ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package android.media.tv;
|
package android.media.tv;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.media.tv.interactive.TvInteractiveAppInfo;
|
import android.media.tv.interactive.TvInteractiveAppServiceInfo;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ public final class AitInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Constructs AIT info.
|
* Constructs AIT info.
|
||||||
*/
|
*/
|
||||||
public AitInfo(@TvInteractiveAppInfo.InteractiveAppType int type, int version) {
|
public AitInfo(@TvInteractiveAppServiceInfo.InteractiveAppType int type, int version) {
|
||||||
mType = type;
|
mType = type;
|
||||||
mVersion = version;
|
mVersion = version;
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ public final class AitInfo implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* Gets interactive app type.
|
* Gets interactive app type.
|
||||||
*/
|
*/
|
||||||
@TvInteractiveAppInfo.InteractiveAppType
|
@TvInteractiveAppServiceInfo.InteractiveAppType
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return mType;
|
return mType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import android.media.tv.TvTrackInfo;
|
|||||||
import android.media.tv.interactive.AppLinkInfo;
|
import android.media.tv.interactive.AppLinkInfo;
|
||||||
import android.media.tv.interactive.ITvInteractiveAppClient;
|
import android.media.tv.interactive.ITvInteractiveAppClient;
|
||||||
import android.media.tv.interactive.ITvInteractiveAppManagerCallback;
|
import android.media.tv.interactive.ITvInteractiveAppManagerCallback;
|
||||||
import android.media.tv.interactive.TvInteractiveAppInfo;
|
import android.media.tv.interactive.TvInteractiveAppServiceInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Surface;
|
import android.view.Surface;
|
||||||
@@ -33,7 +33,7 @@ import android.view.Surface;
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
interface ITvInteractiveAppManager {
|
interface ITvInteractiveAppManager {
|
||||||
List<TvInteractiveAppInfo> getTvInteractiveAppServiceList(int userId);
|
List<TvInteractiveAppServiceInfo> getTvInteractiveAppServiceList(int userId);
|
||||||
void prepare(String tiasId, int type, int userId);
|
void prepare(String tiasId, int type, int userId);
|
||||||
void registerAppLinkInfo(String tiasId, in AppLinkInfo info, int userId);
|
void registerAppLinkInfo(String tiasId, in AppLinkInfo info, int userId);
|
||||||
void unregisterAppLinkInfo(String tiasId, in AppLinkInfo info, int userId);
|
void unregisterAppLinkInfo(String tiasId, in AppLinkInfo info, int userId);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package android.media.tv.interactive;
|
package android.media.tv.interactive;
|
||||||
|
|
||||||
import android.media.tv.interactive.TvInteractiveAppInfo;
|
import android.media.tv.interactive.TvInteractiveAppServiceInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to receive callbacks from ITvInteractiveAppManager regardless of sessions.
|
* Interface to receive callbacks from ITvInteractiveAppManager regardless of sessions.
|
||||||
@@ -26,6 +26,6 @@ interface ITvInteractiveAppManagerCallback {
|
|||||||
void onInteractiveAppServiceAdded(in String iAppServiceId);
|
void onInteractiveAppServiceAdded(in String iAppServiceId);
|
||||||
void onInteractiveAppServiceRemoved(in String iAppServiceId);
|
void onInteractiveAppServiceRemoved(in String iAppServiceId);
|
||||||
void onInteractiveAppServiceUpdated(in String iAppServiceId);
|
void onInteractiveAppServiceUpdated(in String iAppServiceId);
|
||||||
void onTvInteractiveAppInfoUpdated(in TvInteractiveAppInfo tvIAppInfo);
|
void onTvInteractiveAppServiceInfoUpdated(in TvInteractiveAppServiceInfo tvIAppInfo);
|
||||||
void onStateChanged(in String iAppServiceId, int type, int state, int err);
|
void onStateChanged(in String iAppServiceId, int type, int state, int err);
|
||||||
}
|
}
|
||||||
@@ -249,7 +249,7 @@ public final class TvInteractiveAppManager {
|
|||||||
*
|
*
|
||||||
* @see #sendAppLinkCommand(String, Bundle)
|
* @see #sendAppLinkCommand(String, Bundle)
|
||||||
* @see #ACTION_APP_LINK_COMMAND
|
* @see #ACTION_APP_LINK_COMMAND
|
||||||
* @see android.media.tv.interactive.TvInteractiveAppInfo#getId()
|
* @see android.media.tv.interactive.TvInteractiveAppServiceInfo#getId()
|
||||||
*/
|
*/
|
||||||
public static final String INTENT_KEY_INTERACTIVE_APP_SERVICE_ID = "interactive_app_id";
|
public static final String INTENT_KEY_INTERACTIVE_APP_SERVICE_ID = "interactive_app_id";
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ public final class TvInteractiveAppManager {
|
|||||||
*
|
*
|
||||||
* @see #sendAppLinkCommand(String, Bundle)
|
* @see #sendAppLinkCommand(String, Bundle)
|
||||||
* @see #ACTION_APP_LINK_COMMAND
|
* @see #ACTION_APP_LINK_COMMAND
|
||||||
* @see android.media.tv.interactive.TvInteractiveAppInfo#getSupportedTypes()
|
* @see android.media.tv.interactive.TvInteractiveAppServiceInfo#getSupportedTypes()
|
||||||
* @see android.media.tv.interactive.TvInteractiveAppView#createBiInteractiveApp(Uri, Bundle)
|
* @see android.media.tv.interactive.TvInteractiveAppView#createBiInteractiveApp(Uri, Bundle)
|
||||||
*/
|
*/
|
||||||
public static final String INTENT_KEY_BI_INTERACTIVE_APP_TYPE = "bi_interactive_app_type";
|
public static final String INTENT_KEY_BI_INTERACTIVE_APP_TYPE = "bi_interactive_app_type";
|
||||||
@@ -543,11 +543,11 @@ public final class TvInteractiveAppManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTvInteractiveAppInfoUpdated(TvInteractiveAppInfo iAppInfo) {
|
public void onTvInteractiveAppServiceInfoUpdated(TvInteractiveAppServiceInfo iAppInfo) {
|
||||||
// TODO: add public API updateInteractiveAppInfo()
|
// TODO: add public API updateInteractiveAppInfo()
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
for (TvInteractiveAppCallbackRecord record : mCallbackRecords) {
|
for (TvInteractiveAppCallbackRecord record : mCallbackRecords) {
|
||||||
record.postTvInteractiveAppInfoUpdated(iAppInfo);
|
record.postTvInteractiveAppServiceInfoUpdated(iAppInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -611,16 +611,17 @@ public final class TvInteractiveAppManager {
|
|||||||
* This is called when the information about an existing TV Interactive App service has been
|
* This is called when the information about an existing TV Interactive App service has been
|
||||||
* updated.
|
* updated.
|
||||||
*
|
*
|
||||||
* <p>Because the system automatically creates a <code>TvInteractiveAppInfo</code> object
|
* <p>Because the system automatically creates a <code>TvInteractiveAppServiceInfo</code>
|
||||||
* for each TV Interactive App service based on the information collected from the
|
* object for each TV Interactive App service based on the information collected from the
|
||||||
* <code>AndroidManifest.xml</code>, this method is only called back when such information
|
* <code>AndroidManifest.xml</code>, this method is only called back when such information
|
||||||
* has changed dynamically.
|
* has changed dynamically.
|
||||||
*
|
*
|
||||||
* @param iAppInfo The <code>TvInteractiveAppInfo</code> object that contains new
|
* @param iAppInfo The <code>TvInteractiveAppServiceInfo</code> object that contains new
|
||||||
* information.
|
* information.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void onTvInteractiveAppInfoUpdated(@NonNull TvInteractiveAppInfo iAppInfo) {
|
public void onTvInteractiveAppServiceInfoUpdated(
|
||||||
|
@NonNull TvInteractiveAppServiceInfo iAppInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -634,7 +635,7 @@ public final class TvInteractiveAppManager {
|
|||||||
*/
|
*/
|
||||||
public void onTvInteractiveAppServiceStateChanged(
|
public void onTvInteractiveAppServiceStateChanged(
|
||||||
@NonNull String iAppServiceId,
|
@NonNull String iAppServiceId,
|
||||||
@TvInteractiveAppInfo.InteractiveAppType int type,
|
@TvInteractiveAppServiceInfo.InteractiveAppType int type,
|
||||||
@ServiceState int state,
|
@ServiceState int state,
|
||||||
@ErrorCode int err) {
|
@ErrorCode int err) {
|
||||||
}
|
}
|
||||||
@@ -680,11 +681,12 @@ public final class TvInteractiveAppManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void postTvInteractiveAppInfoUpdated(final TvInteractiveAppInfo iAppInfo) {
|
public void postTvInteractiveAppServiceInfoUpdated(
|
||||||
|
final TvInteractiveAppServiceInfo iAppInfo) {
|
||||||
mExecutor.execute(new Runnable() {
|
mExecutor.execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mCallback.onTvInteractiveAppInfoUpdated(iAppInfo);
|
mCallback.onTvInteractiveAppServiceInfoUpdated(iAppInfo);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -737,11 +739,11 @@ public final class TvInteractiveAppManager {
|
|||||||
/**
|
/**
|
||||||
* Returns the complete list of TV Interactive App service on the system.
|
* Returns the complete list of TV Interactive App service on the system.
|
||||||
*
|
*
|
||||||
* @return List of {@link TvInteractiveAppInfo} for each TV Interactive App service that
|
* @return List of {@link TvInteractiveAppServiceInfo} for each TV Interactive App service that
|
||||||
* describes its meta information.
|
* describes its meta information.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public List<TvInteractiveAppInfo> getTvInteractiveAppServiceList() {
|
public List<TvInteractiveAppServiceInfo> getTvInteractiveAppServiceList() {
|
||||||
try {
|
try {
|
||||||
return mService.getTvInteractiveAppServiceList(mUserId);
|
return mService.getTvInteractiveAppServiceList(mUserId);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ public abstract class TvInteractiveAppService extends Service {
|
|||||||
/**
|
/**
|
||||||
* Prepares TV Interactive App service for the given type.
|
* Prepares TV Interactive App service for the given type.
|
||||||
*/
|
*/
|
||||||
public abstract void onPrepare(@TvInteractiveAppInfo.InteractiveAppType int type);
|
public abstract void onPrepare(@TvInteractiveAppServiceInfo.InteractiveAppType int type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a request to register an Android application link info record is received.
|
* Called when a request to register an Android application link info record is received.
|
||||||
@@ -277,7 +277,7 @@ public abstract class TvInteractiveAppService extends Service {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public abstract Session onCreateSession(
|
public abstract Session onCreateSession(
|
||||||
@NonNull String iAppServiceId,
|
@NonNull String iAppServiceId,
|
||||||
@TvInteractiveAppInfo.InteractiveAppType int type);
|
@TvInteractiveAppServiceInfo.InteractiveAppType int type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notifies the system when the state of the interactive app RTE has been changed.
|
* Notifies the system when the state of the interactive app RTE has been changed.
|
||||||
@@ -289,7 +289,7 @@ public abstract class TvInteractiveAppService extends Service {
|
|||||||
* {@link TvInteractiveAppManager#SERVICE_STATE_ERROR}.
|
* {@link TvInteractiveAppManager#SERVICE_STATE_ERROR}.
|
||||||
*/
|
*/
|
||||||
public final void notifyStateChanged(
|
public final void notifyStateChanged(
|
||||||
@TvInteractiveAppInfo.InteractiveAppType int type,
|
@TvInteractiveAppServiceInfo.InteractiveAppType int type,
|
||||||
@TvInteractiveAppManager.ServiceState int state,
|
@TvInteractiveAppManager.ServiceState int state,
|
||||||
@TvInteractiveAppManager.ErrorCode int error) {
|
@TvInteractiveAppManager.ErrorCode int error) {
|
||||||
SomeArgs args = SomeArgs.obtain();
|
SomeArgs args = SomeArgs.obtain();
|
||||||
|
|||||||
@@ -16,4 +16,4 @@
|
|||||||
|
|
||||||
package android.media.tv.interactive;
|
package android.media.tv.interactive;
|
||||||
|
|
||||||
parcelable TvInteractiveAppInfo;
|
parcelable TvInteractiveAppServiceInfo;
|
||||||
@@ -45,9 +45,9 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* This class is used to specify meta information of a TV interactive app.
|
* This class is used to specify meta information of a TV interactive app.
|
||||||
*/
|
*/
|
||||||
public final class TvInteractiveAppInfo implements Parcelable {
|
public final class TvInteractiveAppServiceInfo implements Parcelable {
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
private static final String TAG = "TvInteractiveAppInfo";
|
private static final String TAG = "TvInteractiveAppServiceInfo";
|
||||||
|
|
||||||
private static final String XML_START_TAG_NAME = "tv-interactive-app";
|
private static final String XML_START_TAG_NAME = "tv-interactive-app";
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public final class TvInteractiveAppInfo implements Parcelable {
|
|||||||
private final String mId;
|
private final String mId;
|
||||||
private int mTypes;
|
private int mTypes;
|
||||||
|
|
||||||
public TvInteractiveAppInfo(@NonNull Context context, @NonNull ComponentName component) {
|
public TvInteractiveAppServiceInfo(@NonNull Context context, @NonNull ComponentName component) {
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
throw new IllegalArgumentException("context cannot be null.");
|
throw new IllegalArgumentException("context cannot be null.");
|
||||||
}
|
}
|
||||||
@@ -94,28 +94,28 @@ public final class TvInteractiveAppInfo implements Parcelable {
|
|||||||
mId = id;
|
mId = id;
|
||||||
mTypes = toTypesFlag(types);
|
mTypes = toTypesFlag(types);
|
||||||
}
|
}
|
||||||
private TvInteractiveAppInfo(ResolveInfo service, String id, int types) {
|
private TvInteractiveAppServiceInfo(ResolveInfo service, String id, int types) {
|
||||||
mService = service;
|
mService = service;
|
||||||
mId = id;
|
mId = id;
|
||||||
mTypes = types;
|
mTypes = types;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TvInteractiveAppInfo(@NonNull Parcel in) {
|
private TvInteractiveAppServiceInfo(@NonNull Parcel in) {
|
||||||
mService = ResolveInfo.CREATOR.createFromParcel(in);
|
mService = ResolveInfo.CREATOR.createFromParcel(in);
|
||||||
mId = in.readString();
|
mId = in.readString();
|
||||||
mTypes = in.readInt();
|
mTypes = in.readInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final @NonNull Creator<TvInteractiveAppInfo> CREATOR =
|
public static final @NonNull Creator<TvInteractiveAppServiceInfo> CREATOR =
|
||||||
new Creator<TvInteractiveAppInfo>() {
|
new Creator<TvInteractiveAppServiceInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public TvInteractiveAppInfo createFromParcel(Parcel in) {
|
public TvInteractiveAppServiceInfo createFromParcel(Parcel in) {
|
||||||
return new TvInteractiveAppInfo(in);
|
return new TvInteractiveAppServiceInfo(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TvInteractiveAppInfo[] newArray(int size) {
|
public TvInteractiveAppServiceInfo[] newArray(int size) {
|
||||||
return new TvInteractiveAppInfo[size];
|
return new TvInteractiveAppServiceInfo[size];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -148,12 +148,14 @@ public class TvInteractiveAppView extends ViewGroup {
|
|||||||
/**
|
/**
|
||||||
* Sets the callback to be invoked when an event is dispatched to this TvInteractiveAppView.
|
* Sets the callback to be invoked when an event is dispatched to this TvInteractiveAppView.
|
||||||
*
|
*
|
||||||
* @param callback The callback to receive events. A value of {@code null} removes the existing
|
* @param callback the callback to receive events. MUST NOT be {@code null}.
|
||||||
* callback.
|
*
|
||||||
|
* @see #clearCallback()
|
||||||
*/
|
*/
|
||||||
public void setCallback(
|
public void setCallback(
|
||||||
@NonNull @CallbackExecutor Executor executor,
|
@NonNull @CallbackExecutor Executor executor,
|
||||||
@NonNull TvInteractiveAppCallback callback) {
|
@NonNull TvInteractiveAppCallback callback) {
|
||||||
|
com.android.internal.util.AnnotationValidations.validate(NonNull.class, null, callback);
|
||||||
synchronized (mCallbackLock) {
|
synchronized (mCallbackLock) {
|
||||||
mCallbackExecutor = executor;
|
mCallbackExecutor = executor;
|
||||||
mCallback = callback;
|
mCallback = callback;
|
||||||
@@ -162,6 +164,8 @@ public class TvInteractiveAppView extends ViewGroup {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the callback.
|
* Clears the callback.
|
||||||
|
*
|
||||||
|
* @see #setCallback(Executor, TvInteractiveAppCallback)
|
||||||
*/
|
*/
|
||||||
public void clearCallback() {
|
public void clearCallback() {
|
||||||
synchronized (mCallbackLock) {
|
synchronized (mCallbackLock) {
|
||||||
@@ -389,13 +393,13 @@ public class TvInteractiveAppView extends ViewGroup {
|
|||||||
* Prepares the interactive application.
|
* Prepares the interactive application.
|
||||||
*
|
*
|
||||||
* @param iAppServiceId the interactive app service ID, which can be found in
|
* @param iAppServiceId the interactive app service ID, which can be found in
|
||||||
* {@link TvInteractiveAppInfo#getId()}.
|
* {@link TvInteractiveAppServiceInfo#getId()}.
|
||||||
*
|
*
|
||||||
* @see android.media.tv.interactive.TvInteractiveAppManager#getTvInteractiveAppServiceList()
|
* @see android.media.tv.interactive.TvInteractiveAppManager#getTvInteractiveAppServiceList()
|
||||||
*/
|
*/
|
||||||
public void prepareInteractiveApp(
|
public void prepareInteractiveApp(
|
||||||
@NonNull String iAppServiceId,
|
@NonNull String iAppServiceId,
|
||||||
@TvInteractiveAppInfo.InteractiveAppType int type) {
|
@TvInteractiveAppServiceInfo.InteractiveAppType int type) {
|
||||||
// TODO: document and handle the cases that this method is called multiple times.
|
// TODO: document and handle the cases that this method is called multiple times.
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "prepareInteractiveApp");
|
Log.d(TAG, "prepareInteractiveApp");
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ import android.media.tv.interactive.ITvInteractiveAppService;
|
|||||||
import android.media.tv.interactive.ITvInteractiveAppServiceCallback;
|
import android.media.tv.interactive.ITvInteractiveAppServiceCallback;
|
||||||
import android.media.tv.interactive.ITvInteractiveAppSession;
|
import android.media.tv.interactive.ITvInteractiveAppSession;
|
||||||
import android.media.tv.interactive.ITvInteractiveAppSessionCallback;
|
import android.media.tv.interactive.ITvInteractiveAppSessionCallback;
|
||||||
import android.media.tv.interactive.TvInteractiveAppInfo;
|
|
||||||
import android.media.tv.interactive.TvInteractiveAppService;
|
import android.media.tv.interactive.TvInteractiveAppService;
|
||||||
|
import android.media.tv.interactive.TvInteractiveAppServiceInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Binder;
|
import android.os.Binder;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -130,7 +130,7 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
new Intent(TvInteractiveAppService.SERVICE_INTERFACE),
|
new Intent(TvInteractiveAppService.SERVICE_INTERFACE),
|
||||||
PackageManager.GET_SERVICES | PackageManager.GET_META_DATA,
|
PackageManager.GET_SERVICES | PackageManager.GET_META_DATA,
|
||||||
userId);
|
userId);
|
||||||
List<TvInteractiveAppInfo> iAppList = new ArrayList<>();
|
List<TvInteractiveAppServiceInfo> iAppList = new ArrayList<>();
|
||||||
|
|
||||||
for (ResolveInfo ri : services) {
|
for (ResolveInfo ri : services) {
|
||||||
ServiceInfo si = ri.serviceInfo;
|
ServiceInfo si = ri.serviceInfo;
|
||||||
@@ -143,8 +143,8 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
|
|
||||||
ComponentName component = new ComponentName(si.packageName, si.name);
|
ComponentName component = new ComponentName(si.packageName, si.name);
|
||||||
try {
|
try {
|
||||||
TvInteractiveAppInfo info =
|
TvInteractiveAppServiceInfo info =
|
||||||
new TvInteractiveAppInfo(mContext, component);
|
new TvInteractiveAppServiceInfo(mContext, component);
|
||||||
iAppList.add(info);
|
iAppList.add(info);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Slogf.e(TAG, "failed to load TV Interactive App service " + si.name, e);
|
Slogf.e(TAG, "failed to load TV Interactive App service " + si.name, e);
|
||||||
@@ -154,10 +154,10 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sort the iApp list by iApp service id
|
// sort the iApp list by iApp service id
|
||||||
Collections.sort(iAppList, Comparator.comparing(TvInteractiveAppInfo::getId));
|
Collections.sort(iAppList, Comparator.comparing(TvInteractiveAppServiceInfo::getId));
|
||||||
Map<String, TvInteractiveAppState> iAppMap = new HashMap<>();
|
Map<String, TvInteractiveAppState> iAppMap = new HashMap<>();
|
||||||
ArrayMap<String, Integer> tiasAppCount = new ArrayMap<>(iAppMap.size());
|
ArrayMap<String, Integer> tiasAppCount = new ArrayMap<>(iAppMap.size());
|
||||||
for (TvInteractiveAppInfo info : iAppList) {
|
for (TvInteractiveAppServiceInfo info : iAppList) {
|
||||||
String iAppServiceId = info.getId();
|
String iAppServiceId = info.getId();
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Slogf.d(TAG, "add " + iAppServiceId);
|
Slogf.d(TAG, "add " + iAppServiceId);
|
||||||
@@ -195,7 +195,7 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
|
|
||||||
for (String iAppServiceId : userState.mIAppMap.keySet()) {
|
for (String iAppServiceId : userState.mIAppMap.keySet()) {
|
||||||
if (!iAppMap.containsKey(iAppServiceId)) {
|
if (!iAppMap.containsKey(iAppServiceId)) {
|
||||||
TvInteractiveAppInfo info = userState.mIAppMap.get(iAppServiceId).mInfo;
|
TvInteractiveAppServiceInfo info = userState.mIAppMap.get(iAppServiceId).mInfo;
|
||||||
ServiceState serviceState = userState.mServiceStateMap.get(info.getComponent());
|
ServiceState serviceState = userState.mServiceStateMap.get(info.getComponent());
|
||||||
if (serviceState != null) {
|
if (serviceState != null) {
|
||||||
abortPendingCreateSessionRequestsLocked(serviceState, iAppServiceId, userId);
|
abortPendingCreateSessionRequestsLocked(serviceState, iAppServiceId, userId);
|
||||||
@@ -283,7 +283,7 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
userState.mCallbacks.finishBroadcast();
|
userState.mCallbacks.finishBroadcast();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getInteractiveAppUid(TvInteractiveAppInfo info) {
|
private int getInteractiveAppUid(TvInteractiveAppServiceInfo info) {
|
||||||
try {
|
try {
|
||||||
return getContext().getPackageManager().getApplicationInfo(
|
return getContext().getPackageManager().getApplicationInfo(
|
||||||
info.getServiceInfo().packageName, 0).uid;
|
info.getServiceInfo().packageName, 0).uid;
|
||||||
@@ -642,7 +642,7 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
private final class BinderService extends ITvInteractiveAppManager.Stub {
|
private final class BinderService extends ITvInteractiveAppManager.Stub {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TvInteractiveAppInfo> getTvInteractiveAppServiceList(int userId) {
|
public List<TvInteractiveAppServiceInfo> getTvInteractiveAppServiceList(int userId) {
|
||||||
final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(),
|
final int resolvedUserId = resolveCallingUserId(Binder.getCallingPid(),
|
||||||
Binder.getCallingUid(), userId, "getTvInteractiveAppServiceList");
|
Binder.getCallingUid(), userId, "getTvInteractiveAppServiceList");
|
||||||
final long identity = Binder.clearCallingIdentity();
|
final long identity = Binder.clearCallingIdentity();
|
||||||
@@ -653,7 +653,7 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
mGetServiceListCalled = true;
|
mGetServiceListCalled = true;
|
||||||
}
|
}
|
||||||
UserState userState = getOrCreateUserStateLocked(resolvedUserId);
|
UserState userState = getOrCreateUserStateLocked(resolvedUserId);
|
||||||
List<TvInteractiveAppInfo> iAppList = new ArrayList<>();
|
List<TvInteractiveAppServiceInfo> iAppList = new ArrayList<>();
|
||||||
for (TvInteractiveAppState state : userState.mIAppMap.values()) {
|
for (TvInteractiveAppState state : userState.mIAppMap.values()) {
|
||||||
iAppList.add(state.mInfo);
|
iAppList.add(state.mInfo);
|
||||||
}
|
}
|
||||||
@@ -1738,7 +1738,7 @@ public class TvInteractiveAppManagerService extends SystemService {
|
|||||||
private static final class TvInteractiveAppState {
|
private static final class TvInteractiveAppState {
|
||||||
private String mIAppServiceId;
|
private String mIAppServiceId;
|
||||||
private ComponentName mComponentName;
|
private ComponentName mComponentName;
|
||||||
private TvInteractiveAppInfo mInfo;
|
private TvInteractiveAppServiceInfo mInfo;
|
||||||
private int mUid;
|
private int mUid;
|
||||||
private int mIAppNumber;
|
private int mIAppNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user