From 2c18bafa4b37a4fb0f290d2ed6e32af34f9b519b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 2 Oct 2015 03:22:45 +0200 Subject: [PATCH] Update Cast API --- extern/GmsApi | 2 +- .../google/android/gms/common/api/Api.java | 8 +- .../microg/gms/common/DummyApiConnection.java | 43 ++++++ .../com/google/android/gms/cast/Cast.java | 76 +++++++++- .../gms/cast/CastMediaControlIntent.java | 64 --------- .../android/gms/cast/CastRemoteDisplay.java | 76 ++++++++++ .../gms/cast/CastRemoteDisplayApi.java | 26 ++++ .../cast/CastRemoteDisplayLocalService.java | 28 ++++ .../org/microg/gms/cast/CastApiBuilder.java | 34 +++++ .../java/org/microg/gms/cast/CastApiImpl.java | 134 ++++++++++++++++++ .../org/microg/gms/cast/CastClientImpl.java | 29 ++++ .../gms/cast/CastRemoteDisplayApiBuilder.java | 35 +++++ .../gms/cast/CastRemoteDisplayApiImpl.java | 34 +++++ 13 files changed, 517 insertions(+), 72 deletions(-) create mode 100644 play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java delete mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java diff --git a/extern/GmsApi b/extern/GmsApi index 607fb4ae..bb403701 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 607fb4ae5f7950223a957cd3b7d8406c8d019340 +Subproject commit bb4037017c447d8129abf7c5cbaa73e527da5631 diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java index 8a55af20..1b0f03f2 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java @@ -56,28 +56,28 @@ public final class Api { * Base interface for {@link ApiOptions} in {@link Api}s that have options. */ @PublicApi - public interface HasOptions extends ApiOptions { + interface HasOptions extends ApiOptions { } /** * Base interface for {@link ApiOptions} that are not required, don't exist. */ @PublicApi - public interface NotRequiredOptions extends ApiOptions { + interface NotRequiredOptions extends ApiOptions { } /** * {@link ApiOptions} implementation for {@link Api}s that do not take any options. */ @PublicApi - public final class NoOptions implements NotRequiredOptions { + final class NoOptions implements NotRequiredOptions { } /** * Base interface for {@link ApiOptions} that are optional. */ @PublicApi - public interface Optional extends HasOptions, NotRequiredOptions { + interface Optional extends HasOptions, NotRequiredOptions { } } diff --git a/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java new file mode 100644 index 00000000..355a1675 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.common; + +import org.microg.gms.common.api.ApiConnection; + +public class DummyApiConnection implements ApiConnection { + private boolean connected = false; + + @Override + public void connect() { + connected = true; + } + + @Override + public void disconnect() { + connected = false; + } + + @Override + public boolean isConnected() { + return connected; + } + + @Override + public boolean isConnecting() { + return false; + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java index c84bab98..18065ded 100644 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java @@ -16,18 +16,88 @@ package com.google.android.gms.cast; +import android.os.Bundle; + import com.google.android.gms.common.api.Api; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.Status; +import org.microg.gms.cast.CastApiBuilder; +import org.microg.gms.cast.CastApiImpl; +import org.microg.gms.common.PublicApi; + import java.io.IOException; -public class Cast { +@PublicApi +public final class Cast { - public static final Api API = new Api(null); // TODO - public static final Cast.CastApi CastApi = null; // TODO + /** + * A constant indicating that the Google Cast device is not the currently active video input. + */ + public static final int ACTIVE_INPUT_STATE_NO = 0; + + /** + * A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is + * the currently active video input. Active input state can only be reported when the Google Cast device is + * connected to a TV or AVR with CEC support. + */ + public static final int ACTIVE_INPUT_STATE_UNKNOWN = -1; + + /** + * A constant indicating that the Google Cast device is the currently active video input. + */ + public static final int ACTIVE_INPUT_STATE_YES = 1; + + /** + * A boolean extra for the connection hint bundle passed to + * {@link GoogleApiClient.ConnectionCallbacks#onConnected(Bundle)} that indicates that the connection was + * re-established, but the receiver application that was in use at the time of the connection loss is no longer + * running on the receiver. + */ + public static final String EXTRA_APP_NO_LONGER_RUNNING = "com.google.android.gms.cast.EXTRA_APP_NO_LONGER_RUNNING"; + + /** + * The maximum raw message length (in bytes) that is supported by a Cast channel. + */ + public static final int MAX_MESSAGE_LENGTH = 65536; + + /** + * The maximum length (in characters) of a namespace name. + */ + public static final int MAX_NAMESPACE_LENGTH = 128; + + /** + * A constant indicating that the Google Cast device is not currently in standby. + */ + public static final int STANDBY_STATE_NO = 0; + + /** + * A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is + * currently in standby. Standby state can only be reported when the Google Cast device is connected to a TV or + * AVR with CEC support. + */ + public static final int STANDBY_STATE_UNKNOWN = -1; + + /** + * A constant indicating that the Google Cast device is currently in standby. + */ + public static final int STANDBY_STATE_YES = 1; + + + /** + * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the Cast features. + */ + public static final Api API = new Api(new CastApiBuilder()); + + /** + * An implementation of the CastApi interface. The interface is used to interact with a cast device. + */ + public static final Cast.CastApi CastApi = new CastApiImpl(); + + private Cast() { + } public interface ApplicationConnectionResult extends Result { ApplicationMetadata getApplicationMetadata(); diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java deleted file mode 100644 index e06b87fa..00000000 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2013-2015 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.gms.cast; - -import java.util.Collection; -import java.util.Locale; - -public class CastMediaControlIntent { - public static final String ACTION_SYNC_STATUS = "com.google.android.gms.cast.ACTION_SYNC_STATUS"; - @Deprecated - public static final String CATEGORY_CAST = "com.google.android.gms.cast.CATEGORY_CAST"; - - public static final String EXTRA_CAST_APPLICATION_ID = "com.google.android.gms.cast.EXTRA_CAST_APPLICATION_ID"; - public static final String EXTRA_CAST_LANGUAGE_CODE = "com.google.android.gms.cast.EXTRA_CAST_LANGUAGE_CODE"; - public static final String EXTRA_CAST_RELAUNCH_APPLICATION = "com.google.android.gms.cast.EXTRA_CAST_RELAUNCH_APPLICATION"; - public static final String EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS = "com.google.android.gms.cast.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS"; - public static final String EXTRA_CUSTOM_DATA = "com.google.android.gms.cast.EXTRA_CUSTOM_DATA"; - public static final String EXTRA_DEBUG_LOGGING_ENABLED = "com.google.android.gms.cast.EXTRA_DEBUG_LOGGING_ENABLED"; - public static final String EXTRA_ERROR_CODE = "com.google.android.gms.cast.EXTRA_ERROR_CODE"; - - public static final String DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"; - - public static final int ERROR_CODE_REQUEST_FAILED = 1; - public static final int ERROR_CODE_SESSION_START_FAILED = 2; - public static final int ERROR_CODE_TEMPORARILY_DISCONNECTED = 3; - - public static String categoryForCast(String applicationId) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForCast(String applicationId, Collection namespaces) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForCast(Collection namespaces) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForRemotePlayback(String applicationId) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForRemotePlayback() { - return CATEGORY_CAST; // TODO - } - - public static String languageTagForLocale(Locale locale) { - return CATEGORY_CAST; // TODO - } -} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java new file mode 100644 index 00000000..c6a4bc96 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java @@ -0,0 +1,76 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.cast; + +import android.view.Display; + +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import org.microg.gms.cast.CastRemoteDisplayApiBuilder; +import org.microg.gms.cast.CastRemoteDisplayApiImpl; +import org.microg.gms.common.PublicApi; + +@PublicApi +public final class CastRemoteDisplay { + /** + * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the CastRemoteDisplay features. + */ + public static final Api API = new Api(new CastRemoteDisplayApiBuilder()); + + /** + * An implementation of the CastRemoteDisplayAPI interface. The interface is used to interact with a cast device. + */ + public static final CastRemoteDisplayApi CastApi = new CastRemoteDisplayApiImpl(); + + private CastRemoteDisplay() { + } + + public static final class CastRemoteDisplayOptions implements Api.ApiOptions.HasOptions { + private CastDevice castDevice; + private CastRemoteDisplaySessionCallbacks callbacks; + + private CastRemoteDisplayOptions(CastDevice castDevice, CastRemoteDisplaySessionCallbacks callbacks) { + this.castDevice = castDevice; + this.callbacks = callbacks; + } + + public static final class Builder { + private CastDevice castDevice; + private CastRemoteDisplaySessionCallbacks callbacks; + + public Builder(CastDevice castDevice, CastRemoteDisplaySessionCallbacks callbacks) { + this.castDevice = castDevice; + this.callbacks = callbacks; + } + + public CastRemoteDisplayOptions build() { + return new CastRemoteDisplayOptions(castDevice, callbacks); + } + } + } + + public interface CastRemoteDisplaySessionCallbacks { + void onRemoteDisplayEnded(Status status); + } + + public interface CastRemoteDisplaySessionResult extends Result { + Display getPresentationDisplay(); + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java new file mode 100644 index 00000000..3e1c8774 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java @@ -0,0 +1,26 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.cast; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; + +public interface CastRemoteDisplayApi { + PendingResult startRemoteDisplay(GoogleApiClient apiClient, String applicationId); + + PendingResult stopRemoteDisplay(GoogleApiClient apiClient); +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java new file mode 100644 index 00000000..66dd6fef --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.cast; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; + +public class CastRemoteDisplayLocalService extends Service { + @Override + public IBinder onBind(Intent intent) { + return null; + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java new file mode 100644 index 00000000..ba8704d9 --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.cast; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.cast.Cast; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class CastApiBuilder implements ApiBuilder{ + @Override + public ApiConnection build(Context context, Looper looper, Cast.CastOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new CastClientImpl(context, options, callbacks, connectionFailedListener); + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java new file mode 100644 index 00000000..668773e3 --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java @@ -0,0 +1,134 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.cast; + +import com.google.android.gms.cast.ApplicationMetadata; +import com.google.android.gms.cast.Cast; +import com.google.android.gms.cast.LaunchOptions; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; + +import java.io.IOException; + +// TODO +public class CastApiImpl implements Cast.CastApi { + @Override + public int getActiveInputState(GoogleApiClient client) { + return 0; + } + + @Override + public ApplicationMetadata getApplicationMetadata(GoogleApiClient client) { + return null; + } + + @Override + public String getApplicationStatus(GoogleApiClient client) { + return null; + } + + @Override + public int getStandbyState(GoogleApiClient client) { + return 0; + } + + @Override + public double getVolume(GoogleApiClient client) { + return 0; + } + + @Override + public boolean isMute(GoogleApiClient client) { + return false; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client, String applicationId, String sessionId) { + return null; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client, String applicationId) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId, LaunchOptions launchOptions) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId, boolean relaunchIfRunning) { + return null; + } + + @Override + public PendingResult leaveApplication(GoogleApiClient client) { + return null; + } + + @Override + public void removeMessageReceivedCallbacks(GoogleApiClient client, String namespace) throws IOException { + + } + + @Override + public void requestStatus(GoogleApiClient client) throws IOException { + + } + + @Override + public PendingResult sendMessage(GoogleApiClient client, String namespace, String message) { + return null; + } + + @Override + public void setMessageReceivedCallbacks(GoogleApiClient client, String namespace, Cast.MessageReceivedCallback callbacks) throws IOException { + + } + + @Override + public void setMute(GoogleApiClient client, boolean mute) throws IOException { + + } + + @Override + public void setVolume(GoogleApiClient client, double volume) throws IOException { + + } + + @Override + public PendingResult stopApplication(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult stopApplication(GoogleApiClient client, String sessionId) { + return null; + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java new file mode 100644 index 00000000..071ef58d --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java @@ -0,0 +1,29 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.cast; + +import android.content.Context; + +import com.google.android.gms.cast.Cast; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.DummyApiConnection; + +public class CastClientImpl extends DummyApiConnection { + public CastClientImpl(Context context, Cast.CastOptions options, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java new file mode 100644 index 00000000..29f5810c --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java @@ -0,0 +1,35 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.cast; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.cast.CastRemoteDisplay; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.DummyApiConnection; +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class CastRemoteDisplayApiBuilder implements ApiBuilder { + @Override + public ApiConnection build(Context context, Looper looper, CastRemoteDisplay.CastRemoteDisplayOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new DummyApiConnection(); + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java new file mode 100644 index 00000000..6803ce46 --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.cast; + +import com.google.android.gms.cast.CastRemoteDisplay; +import com.google.android.gms.cast.CastRemoteDisplayApi; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; + +public class CastRemoteDisplayApiImpl implements CastRemoteDisplayApi { + @Override + public PendingResult startRemoteDisplay(GoogleApiClient apiClient, String applicationId) { + return null; + } + + @Override + public PendingResult stopRemoteDisplay(GoogleApiClient apiClient) { + return null; + } +}