diff options
| -rw-r--r-- | media/java/android/media/MediaRouter2A.java | 55 | ||||
| -rw-r--r-- | media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ATest.java | 57 |
2 files changed, 0 insertions, 112 deletions
diff --git a/media/java/android/media/MediaRouter2A.java b/media/java/android/media/MediaRouter2A.java deleted file mode 100644 index 1b89d8fcf735..000000000000 --- a/media/java/android/media/MediaRouter2A.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2019 The Android Open Source Project - * - * 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 android.media; - -import android.annotation.NonNull; -import android.content.Context; - -import com.android.internal.annotations.GuardedBy; - -import java.util.Objects; - -/** - * A new media router - * - * TODO: Replace MediaRouter2 with this file once the implementation is finished. - * @hide - */ -public class MediaRouter2A { - - private static final Object sLock = new Object(); - - @GuardedBy("sLock") - private static MediaRouter2A sInstance; - - /** - * Gets an instance of a MediaRouter. - */ - public static MediaRouter2A getInstance(@NonNull Context context) { - Objects.requireNonNull(context, "context must not be null"); - synchronized (sLock) { - if (sInstance == null) { - sInstance = new MediaRouter2A(context.getApplicationContext()); - } - return sInstance; - } - } - - private MediaRouter2A(Context appContext) { - // TODO: Implement this - } -} diff --git a/media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ATest.java b/media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ATest.java deleted file mode 100644 index dc98a31229f6..000000000000 --- a/media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ATest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2019 The Android Open Source Project - * - * 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.android.mediaroutertest; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; - -import android.content.Context; -import android.media.MediaRouter2A; -import android.support.test.InstrumentationRegistry; -import android.support.test.filters.SmallTest; -import android.support.test.runner.AndroidJUnit4; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(AndroidJUnit4.class) -@SmallTest -public class MediaRouter2ATest { - Context mContext; - - @Before - public void setUp() throws Exception { - mContext = InstrumentationRegistry.getTargetContext(); - } - - @After - public void tearDown() throws Exception { - } - - @Test - public void testGetInstance() throws Exception { - MediaRouter2A router = MediaRouter2A.getInstance(mContext); - assertNotNull(router); - - // Test that it is singleton. - MediaRouter2A router2 = MediaRouter2A.getInstance(mContext); - assertSame(router, router2); - } -} - |