diff --git a/starboard/android/apk/apk_sources.gni b/starboard/android/apk/apk_sources.gni index 4564202094657..41dd2b0a8afb7 100644 --- a/starboard/android/apk/apk_sources.gni +++ b/starboard/android/apk/apk_sources.gni @@ -18,9 +18,6 @@ apk_sources = [ "//starboard/android/apk/app/src/app/java/dev/cobalt/app/CobaltApplication.java", "//starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/account/AccessToken.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/account/NoopUserAuthorizer.java", - "//starboard/android/apk/app/src/main/java/dev/cobalt/account/UserAuthorizer.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/AudioPermissionRequester.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltA11yHelper.java", "//starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java", diff --git a/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java b/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java index 07b6c78ba1867..680eb4674dd06 100644 --- a/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java +++ b/starboard/android/apk/app/src/app/java/dev/cobalt/app/MainActivity.java @@ -16,7 +16,6 @@ import android.app.Activity; import android.app.Service; -import dev.cobalt.account.NoopUserAuthorizer; import dev.cobalt.coat.CobaltActivity; import dev.cobalt.coat.CobaltService; import dev.cobalt.coat.StarboardBridge; @@ -43,13 +42,11 @@ public void run() { getStarboardBridge().requestStop(0); } }; - NoopUserAuthorizer userAuthorizer = new NoopUserAuthorizer(); StarboardBridge bridge = new StarboardBridge( getApplicationContext(), activityHolder, serviceHolder, - userAuthorizer, new ArtworkDownloaderDefault(), args, startDeepLink); diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/account/NoopUserAuthorizer.java b/starboard/android/apk/app/src/main/java/dev/cobalt/account/NoopUserAuthorizer.java deleted file mode 100644 index cf5b7f992bbc0..0000000000000 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/account/NoopUserAuthorizer.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2017 The Cobalt Authors. All Rights Reserved. -// -// 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 dev.cobalt.account; - -import android.content.Intent; -import dev.cobalt.util.UsedByNative; - -/** UserAuthorizer implementation that doesn't try to sign in. */ -@UsedByNative -public class NoopUserAuthorizer implements UserAuthorizer { - - @Override - public void shutdown() {} - - @Override - @SuppressWarnings("unused") - @UsedByNative - public void interrupt() {} - - @Override - @SuppressWarnings("unused") - @UsedByNative - public AccessToken authorizeUser() { - return null; - } - - @Override - @SuppressWarnings("unused") - @UsedByNative - public boolean deauthorizeUser() { - return false; - } - - @Override - @SuppressWarnings("unused") - @UsedByNative - public AccessToken refreshAuthorization() { - return null; - } - - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) {} - - @Override - public void onRequestPermissionsResult( - int requestCode, String[] permissions, int[] grantResults) {} -} diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java index a7e85e0412a52..98e107020f0d8 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java @@ -353,12 +353,6 @@ protected String getIntentUrlAsString(Intent intent) { return (intentUri == null) ? null : intentUri.toString(); } - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - getStarboardBridge().onActivityResult(requestCode, resultCode, data); - } - @SuppressLint("MissingSuperCall") @Override public void onRequestPermissionsResult( diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java index df8227a4a1148..59812a7f14d24 100644 --- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java +++ b/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java @@ -40,7 +40,6 @@ import android.view.accessibility.AccessibilityManager; import android.view.accessibility.CaptioningManager; import androidx.annotation.Nullable; -import dev.cobalt.account.UserAuthorizer; import dev.cobalt.media.ArtworkDownloader; import dev.cobalt.media.AudioOutputManager; import dev.cobalt.media.CaptionSettings; @@ -72,7 +71,6 @@ public interface HostApplication { private CobaltSystemConfigChangeReceiver sysConfigChangeReceiver; private CobaltTextToSpeechHelper ttsHelper; - private UserAuthorizer userAuthorizer; private AudioOutputManager audioOutputManager; private CobaltMediaSession cobaltMediaSession; private AudioPermissionRequester audioPermissionRequester; @@ -123,7 +121,6 @@ public StarboardBridge( Context appContext, Holder activityHolder, Holder serviceHolder, - UserAuthorizer userAuthorizer, ArtworkDownloader artworkDownloader, String[] args, String startDeepLink) { @@ -139,7 +136,6 @@ public StarboardBridge( this.startDeepLink = startDeepLink; this.sysConfigChangeReceiver = new CobaltSystemConfigChangeReceiver(appContext, stopRequester); this.ttsHelper = new CobaltTextToSpeechHelper(appContext); - this.userAuthorizer = userAuthorizer; this.audioOutputManager = new AudioOutputManager(appContext); this.cobaltMediaSession = new CobaltMediaSession(appContext, activityHolder, audioOutputManager, artworkDownloader); @@ -270,7 +266,6 @@ protected void beforeSuspend() { protected void afterStopped() { starboardApplicationStopped = true; ttsHelper.shutdown(); - userAuthorizer.shutdown(); for (CobaltService service : cobaltServices.values()) { service.afterStopped(); } @@ -628,13 +623,6 @@ boolean isAccessibilityHighContrastTextEnabled() { } } - /** Returns Java layer implementation for AndroidUserAuthorizer */ - @SuppressWarnings("unused") - @UsedByNative - public UserAuthorizer getUserAuthorizer() { - return userAuthorizer; - } - @SuppressWarnings("unused") @UsedByNative void updateMediaSession( @@ -711,12 +699,7 @@ AudioPermissionRequester getAudioPermissionRequester() { return audioPermissionRequester; } - void onActivityResult(int requestCode, int resultCode, Intent data) { - userAuthorizer.onActivityResult(requestCode, resultCode, data); - } - void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { - userAuthorizer.onRequestPermissionsResult(requestCode, permissions, grantResults); audioPermissionRequester.onRequestPermissionsResult(requestCode, permissions, grantResults); } diff --git a/starboard/android/apk/app/src/test/java/dev/cobalt/account/AccessTokenTest.java b/starboard/android/apk/app/src/test/java/dev/cobalt/account/AccessTokenTest.java deleted file mode 100644 index 3c54946e8c6fd..0000000000000 --- a/starboard/android/apk/app/src/test/java/dev/cobalt/account/AccessTokenTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package dev.cobalt.account; - -import static com.google.common.truth.Truth.assertThat; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.BlockJUnit4ClassRunner; - -@RunWith(BlockJUnit4ClassRunner.class) -public class AccessTokenTest { - - @Test - public void getTokenValue() { - String token = "token"; - AccessToken undertest = new AccessToken(token, 0); - assertThat(undertest.getTokenValue()).isEqualTo(token); - } - - @Test - public void getExpirySeconds() { - long seconds = 1000; - AccessToken undertest = new AccessToken("", seconds); - assertThat(undertest.getExpirySeconds()).isEqualTo(seconds); - } -} diff --git a/starboard/android/apk/app/src/test/java/dev/cobalt/account/NoopUserAuthorizerTest.java b/starboard/android/apk/app/src/test/java/dev/cobalt/account/NoopUserAuthorizerTest.java deleted file mode 100644 index 4d85bcc1ae52a..0000000000000 --- a/starboard/android/apk/app/src/test/java/dev/cobalt/account/NoopUserAuthorizerTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package dev.cobalt.account; - -import static com.google.common.truth.Truth.assertThat; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.BlockJUnit4ClassRunner; - -@RunWith(BlockJUnit4ClassRunner.class) -public class NoopUserAuthorizerTest { - NoopUserAuthorizer undertest; - - @Before - public void setUp() throws Exception { - undertest = new NoopUserAuthorizer(); - } - - @Test - public void authorizeUser() { - assertThat(undertest.authorizeUser()).isEqualTo(null); - } - - @Test - public void deauthorizeUser() { - assertThat(undertest.deauthorizeUser()).isEqualTo(false); - } - - @Test - public void refreshAuthorization() { - assertThat(undertest.refreshAuthorization()).isEqualTo(null); - } -} diff --git a/starboard/android/shared/platform_configuration/configuration.gni b/starboard/android/shared/platform_configuration/configuration.gni index e788b6c42d9bc..6070c77d70383 100644 --- a/starboard/android/shared/platform_configuration/configuration.gni +++ b/starboard/android/shared/platform_configuration/configuration.gni @@ -45,10 +45,7 @@ platform_tests_path = "//starboard/android/shared:starboard_platform_tests" cobalt_licenses_platform = "android" -enable_account_manager = true - -cobalt_platform_dependencies = - [ "//starboard/android/shared/cobalt:cobalt_platform" ] +cobalt_platform_dependencies = [] cobalt_font_package = "android_system"