Skip to content

Commit

Permalink
Cherry pick PR #3818: remove android_user_authorizer (#3832)
Browse files Browse the repository at this point in the history
Refer to the original PR: youtube/cobalt#3818

It was used by h5vcc_account_manager.idl

b/352168728

---------

Co-authored-by: Colin Liang <[email protected]>
  • Loading branch information
cobalt-github-releaser-bot and zhongqiliang authored Jul 15, 2024
1 parent 46bb83b commit daea1ae
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 150 deletions.
3 changes: 0 additions & 3 deletions starboard/android/apk/apk_sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -123,7 +121,6 @@ public StarboardBridge(
Context appContext,
Holder<Activity> activityHolder,
Holder<Service> serviceHolder,
UserAuthorizer userAuthorizer,
ArtworkDownloader artworkDownloader,
String[] args,
String startDeepLink) {
Expand All @@ -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);
Expand Down Expand Up @@ -270,7 +266,6 @@ protected void beforeSuspend() {
protected void afterStopped() {
starboardApplicationStopped = true;
ttsHelper.shutdown();
userAuthorizer.shutdown();
for (CobaltService service : cobaltServices.values()) {
service.afterStopped();
}
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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);
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit daea1ae

Please sign in to comment.