The focus always starts from the middle number 5. When user changes focus, the focus is then
+// * moved to either 2, 4, 6 or 8 and we can capture the movement this way. The focus is then
+// * quickly switched back to the center 5 to be ready for the next movement.
+// */
+// @Override
+// protected void onPopulateNodeForVirtualView(int virtualViewId, AccessibilityNodeInfoCompat node) {
+// int focusedViewId = getAccessibilityFocusedVirtualViewId();
+
+// if (focusedViewId < 1 || focusedViewId > 9) {
+// // If this is not one of our nine-patch views, it's probably HOST_ID
+// // In any case, assume there is no focus change.
+// focusedViewId = CENTER_VIEW_ID;
+// }
+
+// // onPopulateNodeForVirtualView() gets called at least once every
+// // time the focused view changes. So see if it's changed since the
+// // last time we've been called and inject an event if so.
+// if (focusedViewId != CENTER_VIEW_ID) {
+// maybeInjectEvent(focusedViewId);
+// } else {
+// unhandledInput = true;
+// }
+
+// int x = (virtualViewId - 1) % 3;
+// int y = (virtualViewId - 1) / 3;
+
+// // Note that the specific bounds here are arbitrary. The importance
+// // is the relative bounds to each other.
+// node.setBoundsInParent(
+// new Rect(
+// x * FAKE_VIEW_WIDTH,
+// y * FAKE_VIEW_HEIGHT,
+// x * FAKE_VIEW_WIDTH + FAKE_VIEW_WIDTH,
+// y * FAKE_VIEW_HEIGHT + FAKE_VIEW_HEIGHT));
+// node.setText("");
+
+// if (virtualViewId >= 1 || virtualViewId <= 9) {
+// nodePopulatedSet.set(virtualViewId - 1);
+// }
+// if (!hasInitialFocusBeenSet && nodePopulatedSet.cardinality() == 9) {
+// // Once the ExploreByTouchHelper knows about all of our virtual views,
+// // but not before, ask that the accessibility focus be moved from
+// // it's initial position on HOST_ID to the one we want to start with.
+// hasInitialFocusBeenSet = true;
+// focusOnCenter();
+// }
+// }
+
+// @Override
+// protected boolean onPerformActionForVirtualView(int virtualViewId, int action, Bundle arguments) {
+// return false;
+// }
+// }
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
similarity index 90%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
index d566fa98823f..9b2bdee67eee 100644
--- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java
@@ -29,9 +29,7 @@
import android.view.ViewGroup.LayoutParams;
import android.view.ViewParent;
import android.widget.FrameLayout;
-import androidx.annotation.CallSuper;
-import com.google.androidgamesdk.GameActivity;
-import dev.cobalt.media.AudioOutputManager;
+// import dev.cobalt.media.AudioOutputManager;
import dev.cobalt.media.MediaCodecCapabilitiesLogger;
import dev.cobalt.media.VideoSurfaceView;
import dev.cobalt.util.DisplayUtil;
@@ -43,8 +41,10 @@
import java.util.Locale;
import java.util.regex.Pattern;
+import org.chromium.content_shell_apk.ContentShellActivity;
+
/** Native activity that has the required JNI methods called by the Starboard implementation. */
-public abstract class CobaltActivity extends GameActivity {
+public abstract class CobaltActivity extends ContentShellActivity {
// A place to put args while debugging so they're used even when starting from the launcher.
// This should always be empty in submitted code.
@@ -68,18 +68,15 @@ public abstract class CobaltActivity extends GameActivity {
private static final Pattern URL_PARAM_PATTERN = Pattern.compile("^[a-zA-Z0-9_=]*$");
- @SuppressWarnings("unused")
- private CobaltA11yHelper a11yHelper;
-
private VideoSurfaceView videoSurfaceView;
private boolean forceCreateNewVideoSurfaceView = false;
private long timeInNanoseconds;
- private static native void nativeLowMemoryEvent();
+ // private static native void nativeLowMemoryEvent();
- protected View mContentView = null;
+ // protected View mContentView = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -91,6 +88,7 @@ protected void onCreate(Bundle savedInstanceState) {
// STREAM_MUSIC whenever the target activity or fragment is visible.
setVolumeControlStream(AudioManager.STREAM_MUSIC);
+ // TODO(b/374147993): how to handle deeplink in Chrobalt?
String startDeepLink = getIntentUrlAsString(getIntent());
if (getStarboardBridge() == null) {
// Cold start - Instantiate the singleton StarboardBridge.
@@ -101,32 +99,14 @@ protected void onCreate(Bundle savedInstanceState) {
getStarboardBridge().handleDeepLink(startDeepLink);
}
- // super.onCreate() will cause an APP_CMD_START in native code,
- // so make sure to initialize any state beforehand that might be touched by
- // native code invocations.
+ super.setStartupUrl("https://www.youtube.com/tv");
super.onCreate(savedInstanceState);
videoSurfaceView = new VideoSurfaceView(this);
- a11yHelper = new CobaltA11yHelper(videoSurfaceView);
addContentView(
videoSurfaceView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
}
- /**
- * Creates an empty View for the launching activity, and prevent GameActivity from creating the
- * default SurfaceView.
- */
- @Override
- protected void onCreateSurfaceView() {
- mSurfaceView = null;
-
- getWindow().takeSurface(this);
-
- mContentView = new View(this);
- setContentView(mContentView);
- mContentView.requestFocus();
- }
-
/**
* Instantiates the StarboardBridge. Apps not supporting sign-in should inject an instance of
* NoopUserAuthorizer. Apps may subclass StarboardBridge if they need to override anything.
@@ -141,7 +121,7 @@ protected StarboardBridge getStarboardBridge() {
@Override
protected void onStart() {
if (!isReleaseBuild()) {
- getStarboardBridge().getAudioOutputManager().dumpAllOutputDevices();
+ // getStarboardBridge().getAudioOutputManager().dumpAllOutputDevices();
MediaCodecCapabilitiesLogger.dumpAllDecoders();
}
if (forceCreateNewVideoSurfaceView) {
@@ -151,7 +131,7 @@ protected void onStart() {
DisplayUtil.cacheDefaultDisplay(this);
DisplayUtil.addDisplayListener(this);
- AudioOutputManager.addAudioDeviceListener(this);
+ // AudioOutputManager.addAudioDeviceListener(this);
getStarboardBridge().onActivityStart(this);
super.onStart();
@@ -331,7 +311,6 @@ protected boolean isReleaseBuild() {
return StarboardBridge.isReleaseBuild();
}
- @CallSuper
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
@@ -346,12 +325,12 @@ protected String getIntentUrlAsString(Intent intent) {
return (intentUri == null) ? null : intentUri.toString();
}
- @SuppressLint("MissingSuperCall")
- @Override
- public void onRequestPermissionsResult(
- int requestCode, String[] permissions, int[] grantResults) {
- getStarboardBridge().onRequestPermissionsResult(requestCode, permissions, grantResults);
- }
+ // @SuppressLint("MissingSuperCall")
+ // @Override
+ // public void onRequestPermissionsResult(
+ // int requestCode, String[] permissions, int[] grantResults) {
+ // getStarboardBridge().onRequestPermissionsResult(requestCode, permissions, grantResults);
+ // }
public void resetVideoSurface() {
runOnUiThread(
@@ -402,7 +381,6 @@ private void createNewSurfaceView() {
int index = frameLayout.indexOfChild(videoSurfaceView);
frameLayout.removeView(videoSurfaceView);
videoSurfaceView = new VideoSurfaceView(this);
- a11yHelper = new CobaltA11yHelper(videoSurfaceView);
frameLayout.addView(
videoSurfaceView,
index,
@@ -415,7 +393,7 @@ private void createNewSurfaceView() {
@Override
public void onLowMemory() {
super.onLowMemory();
- nativeLowMemoryEvent();
+ // nativeLowMemoryEvent();
}
public long getAppStartTimestamp() {
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltHttpHelper.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltHttpHelper.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltHttpHelper.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltHttpHelper.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltMediaSession.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java
similarity index 84%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java
index 8588be831f82..f63f1e3aa2d2 100644
--- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltService.java
@@ -23,6 +23,7 @@
public abstract class CobaltService {
// Indicate is the service opened, and be able to send data to client
protected boolean opened = true;
+ private final Object lock = new Object();
/** Interface that returns an object that extends CobaltService. */
public interface Factory {
@@ -76,7 +77,7 @@ public static class ResponseToClient {
@SuppressWarnings("unused")
@UsedByNative
public void onClose() {
- synchronized (this) {
+ synchronized (lock) {
opened = false;
close();
}
@@ -87,22 +88,12 @@ public void onClose() {
/**
* Send data from the service to the client.
*
- *
This may be called from a separate thread, do not call nativeSendToClient() once onClose()
- * is processed.
*/
protected void sendToClient(long nativeService, byte[] data) {
- synchronized (this) {
- if (!opened) {
- Log.w(
- TAG,
- "Platform service did not send data to client, because client already closed the"
- + " platform service.");
- return;
- }
-
- nativeSendToClient(nativeService, data);
- }
+ // TODO(b/372558900): Implement Javascript Injection
}
- private native void nativeSendToClient(long nativeService, byte[] data);
+ private void nativeSendToClient(long nativeService, byte[] data) {
+ // TODO(b/372558900): Implement Javascript Injection
+ }
}
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltSystemConfigChangeReceiver.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltSystemConfigChangeReceiver.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltSystemConfigChangeReceiver.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltSystemConfigChangeReceiver.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltTextToSpeechHelper.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltTextToSpeechHelper.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltTextToSpeechHelper.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltTextToSpeechHelper.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/CrashContextUpdateHandler.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CrashContextUpdateHandler.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/CrashContextUpdateHandler.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CrashContextUpdateHandler.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ErrorDialog.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/ErrorDialog.java
similarity index 94%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/ErrorDialog.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/ErrorDialog.java
index 775c493297c4..fe1498183155 100644
--- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ErrorDialog.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/ErrorDialog.java
@@ -94,11 +94,11 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.coat_error_dialog);
ImageView imageView = (ImageView) findViewById(R.id.image);
- Drawable drawable =
- getContext()
- .getResources()
- .getDrawable(R.drawable.lb_ic_sad_cloud, getContext().getTheme());
- imageView.setImageDrawable(drawable);
+ // Drawable drawable =
+ // getContext()
+ // .getResources()
+ // .getDrawable(R.drawable.lb_ic_sad_cloud, getContext().getTheme());
+ // imageView.setImageDrawable(drawable);
TextView messageView = (TextView) findViewById(R.id.message);
messageView.setText(params.messageId);
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/MediaImage.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/NetworkStatus.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/NetworkStatus.java
similarity index 97%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/NetworkStatus.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/NetworkStatus.java
index 5904910681ec..471c53f80ec4 100644
--- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/NetworkStatus.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/NetworkStatus.java
@@ -65,7 +65,7 @@ public void run() {
}
private void sendStatusChangeInternal(boolean online) {
- nativeOnNetworkStatusChange(online);
+ // nativeOnNetworkStatusChange(online);
}
public NetworkStatus(Context appContext) {
@@ -109,5 +109,5 @@ public boolean isConnected() {
}
}
- private native void nativeOnNetworkStatusChange(boolean online);
+ // private native void nativeOnNetworkStatusChange(boolean online);
}
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/NullCobaltFactory.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/NullCobaltFactory.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/NullCobaltFactory.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/NullCobaltFactory.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/PlatformError.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/PlatformError.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/PlatformError.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/PlatformError.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/ResourceOverlay.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/ResourceOverlay.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/ResourceOverlay.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/ResourceOverlay.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
similarity index 90%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
index c0b7b209695b..fa57734ddd8f 100644
--- a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/StarboardBridge.java
@@ -38,7 +38,7 @@
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.CaptioningManager;
import androidx.annotation.Nullable;
-import dev.cobalt.media.AudioOutputManager;
+// import dev.cobalt.media.AudioOutputManager;
import dev.cobalt.util.DisplayUtil;
import dev.cobalt.util.Holder;
import dev.cobalt.util.Log;
@@ -65,25 +65,15 @@ public interface HostApplication {
private CobaltSystemConfigChangeReceiver sysConfigChangeReceiver;
private CobaltTextToSpeechHelper ttsHelper;
- private AudioOutputManager audioOutputManager;
- private CobaltMediaSession cobaltMediaSession;
- private AudioPermissionRequester audioPermissionRequester;
+ // private AudioOutputManager audioOutputManager;
+ // private CobaltMediaSession cobaltMediaSession;
+ // private AudioPermissionRequester audioPermissionRequester;
private NetworkStatus networkStatus;
private ResourceOverlay resourceOverlay;
- private AdvertisingId advertisingId;
+ // private AdvertisingId advertisingId;
private VolumeStateReceiver volumeStateReceiver;
private CrashContextUpdateHandler crashContextUpdateHandler;
- static {
- // Even though NativeActivity already loads our library from C++,
- // we still have to load it from Java to make JNI calls into it.
-
- // GameActivity has code to load the libcobalt.so as well.
- // It reads the library name from the meta data field "android.app.lib_name" in the
- // AndroidManifest.xml
- System.loadLibrary("cobalt");
- }
-
private final Context appContext;
private final Holder activityHolder;
private final Holder serviceHolder;
@@ -97,8 +87,8 @@ public void run() {
}
};
- private volatile boolean starboardApplicationStopped = false;
- private volatile boolean starboardApplicationReady = false;
+ private volatile boolean starboardApplicationStopped;
+ private volatile boolean starboardApplicationReady;
private final HashMap cobaltServiceFactories = new HashMap<>();
private final HashMap cobaltServices = new HashMap<>();
@@ -121,7 +111,7 @@ public StarboardBridge(
// Make sure the JNI stack is properly initialized first as there is
// race condition as soon as any of the following objects creates a new thread.
- nativeInitialize();
+ // nativeInitialize();
this.appContext = appContext;
this.activityHolder = activityHolder;
@@ -130,20 +120,23 @@ public StarboardBridge(
this.startDeepLink = startDeepLink;
this.sysConfigChangeReceiver = new CobaltSystemConfigChangeReceiver(appContext, stopRequester);
this.ttsHelper = new CobaltTextToSpeechHelper(appContext);
- this.audioOutputManager = new AudioOutputManager(appContext);
- this.cobaltMediaSession =
- new CobaltMediaSession(appContext, activityHolder, audioOutputManager, artworkDownloader);
- this.audioPermissionRequester = new AudioPermissionRequester(appContext, activityHolder);
+ // this.audioOutputManager = new AudioOutputManager(appContext);
+ // this.cobaltMediaSession =
+ // new CobaltMediaSession(appContext, activityHolder, audioOutputManager, artworkDownloader);
+ // this.audioPermissionRequester = new AudioPermissionRequester(appContext, activityHolder);
this.networkStatus = new NetworkStatus(appContext);
this.resourceOverlay = new ResourceOverlay(appContext);
- this.advertisingId = new AdvertisingId(appContext);
+ // this.advertisingId = new AdvertisingId(appContext);
this.volumeStateReceiver = new VolumeStateReceiver(appContext);
this.isAmatiDevice = appContext.getPackageManager().hasSystemFeature(AMATI_EXPERIENCE_FEATURE);
}
- private native boolean nativeInitialize();
+ // private boolean nativeInitialize();
- private native long nativeCurrentMonotonicTime();
+ private long nativeCurrentMonotonicTime() {
+ // TODO(b/375058047)
+ return 0;
+ }
protected void onActivityStart(Activity activity) {
activityHolder.set(activity);
@@ -183,12 +176,12 @@ protected void beforeStartOrResume() {
Log.i(TAG, "Prepare to resume");
// Bring our platform services to life before resuming so that they're ready to deal with
// whatever the web app wants to do with them as part of its start/resume logic.
- cobaltMediaSession.resume();
+ // cobaltMediaSession.resume();
networkStatus.beforeStartOrResume();
for (CobaltService service : cobaltServices.values()) {
service.beforeStartOrResume();
}
- advertisingId.refresh();
+ // advertisingId.refresh();
}
@SuppressWarnings("unused")
@@ -199,7 +192,7 @@ protected void beforeSuspend() {
// We want the MediaSession to be deactivated immediately before suspending so that by the
// time, the launcher is visible our "Now Playing" card is already gone. Then Cobalt and
// the web app can take their time suspending after that.
- cobaltMediaSession.suspend();
+ // cobaltMediaSession.suspend();
networkStatus.beforeSuspend();
for (CobaltService service : cobaltServices.values()) {
service.beforeSuspend();
@@ -247,11 +240,11 @@ protected void starboardApplicationStopping() {
public void requestStop(int errorLevel) {
if (starboardApplicationReady) {
Log.i(TAG, "Request to stop");
- nativeStopApp(errorLevel);
+ // nativeStopApp(errorLevel);
}
}
- private native void nativeStopApp(int errorLevel);
+ // private native void nativeStopApp(int errorLevel);
@SuppressWarnings("unused")
@UsedByNative
@@ -264,13 +257,13 @@ public void requestSuspend() {
}
public boolean onSearchRequested() {
- if (starboardApplicationReady) {
- return nativeOnSearchRequested();
- }
+ // if (starboardApplicationReady) {
+ // return nativeOnSearchRequested();
+ // }
return false;
}
- private native boolean nativeOnSearchRequested();
+ // private native boolean nativeOnSearchRequested();
@SuppressWarnings("unused")
@UsedByNative
@@ -287,10 +280,11 @@ void raisePlatformError(@PlatformError.ErrorType int errorType, long data) {
/** Returns true if the native code is compiled for release (i.e. 'gold' build). */
public static boolean isReleaseBuild() {
- return nativeIsReleaseBuild();
+ // return nativeIsReleaseBuild();
+ return false;
}
- private static native boolean nativeIsReleaseBuild();
+ // private static native boolean nativeIsReleaseBuild();
protected Holder getActivityHolder() {
return activityHolder;
@@ -320,7 +314,9 @@ public void handleDeepLink(String url) {
}
}
- private native void nativeHandleDeepLink(String url);
+ private void nativeHandleDeepLink(String url) {
+ // TODO(b/374147993): Implement deep link
+ }
/**
* Returns the absolute path to the directory where application specific files should be written.
@@ -583,14 +579,14 @@ void updateMediaSession(
String album,
MediaImage[] artwork,
long duration) {
- cobaltMediaSession.updateMediaSession(
- playbackState, actions, positionMs, speed, title, artist, album, artwork, duration);
+ // cobaltMediaSession.updateMediaSession(
+ // playbackState, actions, positionMs, speed, title, artist, album, artwork, duration);
}
@SuppressWarnings("unused")
@UsedByNative
public void deactivateMediaSession() {
- cobaltMediaSession.deactivateMediaSession();
+ // cobaltMediaSession.deactivateMediaSession();
}
/** Returns string for kSbSystemPropertyUserAgentAuxField */
@@ -625,32 +621,34 @@ protected String getUserAgentAuxField() {
@SuppressWarnings("unused")
@UsedByNative
protected String getAdvertisingId() {
- return this.advertisingId.getId();
+ // return this.advertisingId.getId();
+ return "";
}
/** Returns boolean for kSbSystemPropertyLimitAdTracking */
@SuppressWarnings("unused")
@UsedByNative
protected boolean getLimitAdTracking() {
- return this.advertisingId.isLimitAdTrackingEnabled();
+ // return this.advertisingId.isLimitAdTrackingEnabled();
+ return false;
}
- @SuppressWarnings("unused")
- @UsedByNative
- AudioOutputManager getAudioOutputManager() {
- return audioOutputManager;
- }
+ // @SuppressWarnings("unused")
+ // @UsedByNative
+ // AudioOutputManager getAudioOutputManager() {
+ // return audioOutputManager;
+ // }
/** Returns Java layer implementation for AudioPermissionRequester */
- @SuppressWarnings("unused")
- @UsedByNative
- AudioPermissionRequester getAudioPermissionRequester() {
- return audioPermissionRequester;
- }
+ // @SuppressWarnings("unused")
+ // @UsedByNative
+ // AudioPermissionRequester getAudioPermissionRequester() {
+ // return audioPermissionRequester;
+ // }
- void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
- audioPermissionRequester.onRequestPermissionsResult(requestCode, permissions, grantResults);
- }
+ // void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
+ // audioPermissionRequester.onRequestPermissionsResult(requestCode, permissions, grantResults);
+ // }
@SuppressWarnings("unused")
@UsedByNative
@@ -688,9 +686,9 @@ public int[] getSupportedHdrTypes() {
}
/** Return the CobaltMediaSession. */
- public CobaltMediaSession cobaltMediaSession() {
- return cobaltMediaSession;
- }
+ // public CobaltMediaSession cobaltMediaSession() {
+ // return cobaltMediaSession;
+ // }
public void registerCobaltService(CobaltService.Factory factory) {
cobaltServiceFactories.put(factory.getServiceName(), factory);
@@ -740,7 +738,8 @@ protected long getIncorrectAppStartTimestamp() {
Activity activity = activityHolder.get();
if (activity instanceof CobaltActivity) {
long javaStartTimestamp = ((CobaltActivity) activity).getAppStartTimestamp();
- long cppTimestamp = nativeCurrentMonotonicTime();
+ // long cppTimestamp = nativeCurrentMonotonicTime();
+ long cppTimestamp = System.nanoTime();
long javaStopTimestamp = System.nanoTime();
return cppTimestamp
- (javaStartTimestamp - javaStopTimestamp) / timeNanosecondsPerMicrosecond;
@@ -755,7 +754,8 @@ protected long getAppStartTimestamp() {
Activity activity = activityHolder.get();
if (activity instanceof CobaltActivity) {
long javaStartTimestamp = ((CobaltActivity) activity).getAppStartTimestamp();
- long cppTimestamp = nativeCurrentMonotonicTime();
+ // long cppTimestamp = nativeCurrentMonotonicTime();
+ long cppTimestamp = System.nanoTime();
long javaStopTimestamp = System.nanoTime();
return cppTimestamp
- (javaStopTimestamp - javaStartTimestamp) / timeNanosecondsPerMicrosecond;
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/coat/VolumeStateReceiver.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/VolumeStateReceiver.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/coat/VolumeStateReceiver.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/coat/VolumeStateReceiver.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/README.md b/cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/README.md
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/README.md
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/README.md
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/games-activity-2.0.2.aar b/cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/games-activity-2.0.2.aar
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/games-activity-2.0.2.aar
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/game_activity/games-activity-2.0.2.aar
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfo.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfo.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfo.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfo.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfoModule.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfoModule.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfoModule.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/ClientLogInfoModule.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/client_log_info_demo.html b/cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/client_log_info_demo.html
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/client_log_info_demo.html
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/libraries/services/clientloginfo/client_log_info_demo.html
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/AudioOutputManager.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/AudioTrackBridge.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/Log.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/Log.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/Log.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/Log.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridge.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridge.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridge.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridge.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridgeBuilder.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridgeBuilder.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridgeBuilder.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecBridgeBuilder.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecCapabilitiesLogger.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecCapabilitiesLogger.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecCapabilitiesLogger.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecCapabilitiesLogger.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecStatus.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecStatus.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecStatus.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecStatus.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecUtil.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecUtil.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecUtil.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaCodecUtil.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaDrmBridge.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaDrmBridge.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaDrmBridge.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaDrmBridge.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaFormatBuilder.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaFormatBuilder.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaFormatBuilder.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/MediaFormatBuilder.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoDecoderCache.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoDecoderCache.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoDecoderCache.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoDecoderCache.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoFrameReleaseTimeHelper.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoFrameReleaseTimeHelper.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoFrameReleaseTimeHelper.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoFrameReleaseTimeHelper.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceTexture.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceTexture.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceTexture.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceTexture.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceView.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceView.java
similarity index 91%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceView.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceView.java
index a4ef40ea4b1f..86f038d188b0 100644
--- a/starboard/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceView.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/media/VideoSurfaceView.java
@@ -42,7 +42,7 @@ public class VideoSurfaceView extends SurfaceView {
// Reset video surface on nexus player to avoid b/159073388.
if (needResetSurfaceList.contains(Build.MODEL)) {
- nativeSetNeedResetSurface();
+ // nativeSetNeedResetSurface();
}
}
@@ -75,9 +75,9 @@ private void initialize(Context context) {
// punch-out video when the position / size is animated.
}
- private static native void nativeOnVideoSurfaceChanged(Surface surface);
+ // private static native void nativeOnVideoSurfaceChanged(Surface surface);
- private static native void nativeSetNeedResetSurface();
+ // private static native void nativeSetNeedResetSurface();
private class SurfaceHolderCallback implements SurfaceHolder.Callback {
@@ -86,7 +86,7 @@ private class SurfaceHolderCallback implements SurfaceHolder.Callback {
@Override
public void surfaceCreated(SurfaceHolder holder) {
currentSurface = holder.getSurface();
- nativeOnVideoSurfaceChanged(currentSurface);
+ // nativeOnVideoSurfaceChanged(currentSurface);
}
@Override
@@ -101,7 +101,7 @@ public void surfaceChanged(SurfaceHolder holder, int format, int width, int heig
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
currentSurface = null;
- nativeOnVideoSurfaceChanged(currentSurface);
+ // nativeOnVideoSurfaceChanged(currentSurface);
}
}
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/storage/CobaltStorageLoader.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/storage/CobaltStorageLoader.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/storage/CobaltStorageLoader.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/storage/CobaltStorageLoader.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/storage/README.md b/cobalt/android/apk/app/src/main/java/dev/cobalt/storage/README.md
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/storage/README.md
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/storage/README.md
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/storage/StorageProto.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/storage/StorageProto.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/storage/StorageProto.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/storage/StorageProto.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/util/DisplayUtil.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/DisplayUtil.java
similarity index 96%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/util/DisplayUtil.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/util/DisplayUtil.java
index 2c0ad78120cf..094d8a1bea76 100644
--- a/starboard/android/apk/app/src/main/java/dev/cobalt/util/DisplayUtil.java
+++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/DisplayUtil.java
@@ -154,17 +154,17 @@ private static DisplayMetrics getDisplayMetrics() {
new DisplayListener() {
@Override
public void onDisplayAdded(int displayId) {
- nativeOnDisplayChanged();
+ // nativeOnDisplayChanged();
}
@Override
public void onDisplayChanged(int displayId) {
- nativeOnDisplayChanged();
+ // nativeOnDisplayChanged();
}
@Override
public void onDisplayRemoved(int displayId) {
- nativeOnDisplayChanged();
+ // nativeOnDisplayChanged();
}
};
@@ -181,8 +181,8 @@ public static void addDisplayListener(Context context) {
// Call nativeOnDisplayChanged() to reload supported hdr types here after a default
// Display created.
- nativeOnDisplayChanged();
+ // nativeOnDisplayChanged();
}
- private static native void nativeOnDisplayChanged();
+ // private static native void nativeOnDisplayChanged();
}
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/util/Holder.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/Holder.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/util/Holder.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/util/Holder.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/util/IsEmulator.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/IsEmulator.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/util/IsEmulator.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/util/IsEmulator.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/util/Log.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/Log.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/util/Log.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/util/Log.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/util/SynchronizedHolder.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/SynchronizedHolder.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/util/SynchronizedHolder.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/util/SynchronizedHolder.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/util/SystemPropertiesHelper.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/SystemPropertiesHelper.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/util/SystemPropertiesHelper.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/util/SystemPropertiesHelper.java
diff --git a/starboard/android/apk/app/src/main/java/dev/cobalt/util/UsedByNative.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/util/UsedByNative.java
similarity index 100%
rename from starboard/android/apk/app/src/main/java/dev/cobalt/util/UsedByNative.java
rename to cobalt/android/apk/app/src/main/java/dev/cobalt/util/UsedByNative.java
diff --git a/starboard/android/apk/app/src/main/res/layout/coat_error_dialog.xml b/cobalt/android/apk/app/src/main/res/layout/coat_error_dialog.xml
similarity index 93%
rename from starboard/android/apk/app/src/main/res/layout/coat_error_dialog.xml
rename to cobalt/android/apk/app/src/main/res/layout/coat_error_dialog.xml
index c3f639060d84..e3cd1a172fe7 100644
--- a/starboard/android/apk/app/src/main/res/layout/coat_error_dialog.xml
+++ b/cobalt/android/apk/app/src/main/res/layout/coat_error_dialog.xml
@@ -36,15 +36,15 @@
+ android:maxWidth="50dp"
+ />