Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8345)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/remote/NotificationTransportControl.java

Issue 1561663002: Use long for times and timestamps throught Java cast code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/media/remote/NotificationTransportControl.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/NotificationTransportControl.java b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/NotificationTransportControl.java
index 683f119f74306527527f4f044af758c51d363f8d..72c3b1bf16410b97eccb01c316965459a2af2314 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/NotificationTransportControl.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/NotificationTransportControl.java
@@ -34,10 +34,10 @@ import javax.annotation.Nullable;
public class NotificationTransportControl
extends TransportControl implements MediaRouteController.UiListener {
/**
- * Service used to transform intent requests triggered from the notification into
- * {@code Listener} callbacks. Ideally this class should be protected, but public is required
- * to create as a service.
- */
+ * Service used to transform intent requests triggered from the notification into
+ * {@code Listener} callbacks. Ideally this class should be protected, but public is required to
+ * create as a service.
+ */
public static class ListenerService extends Service {
private static final String ACTION_PREFIX = ListenerService.class.getName() + ".";
@@ -185,8 +185,8 @@ public class NotificationTransportControl
case PLAYING:
showProgress = true;
showPlayPause = true;
- contentView.setProgressBar(R.id.progress, videoInfo.durationMillis,
- videoInfo.currentTimeMillis, false);
+ contentView.setProgressBar(R.id.progress, (int) videoInfo.durationMillis,
whywhat 2016/01/05 21:19:24 is this typecast a potential problem for really lo
aberent 2016/01/06 11:13:34 Done (although I think you will have trouble findi
+ (int) videoInfo.currentTimeMillis, false);
contentView.setImageViewResource(
R.id.playpause, R.drawable.ic_vidcontrol_pause);
contentView.setContentDescription(
@@ -198,8 +198,8 @@ public class NotificationTransportControl
case PAUSED:
showProgress = true;
showPlayPause = true;
- contentView.setProgressBar(R.id.progress, videoInfo.durationMillis,
- videoInfo.currentTimeMillis, false);
+ contentView.setProgressBar(R.id.progress, (int) videoInfo.durationMillis,
+ (int) videoInfo.currentTimeMillis, false);
contentView.setImageViewResource(
R.id.playpause, R.drawable.ic_vidcontrol_play);
contentView.setContentDescription(
@@ -358,7 +358,6 @@ public class NotificationTransportControl
return Bitmap.createScaledBitmap(bitmap, width, height, false);
}
-
private NotificationTransportControl(Context context) {
this.mContext = context;
mHandler = new Handler(context.getMainLooper());
@@ -381,7 +380,7 @@ public class NotificationTransportControl
}
@Override
- public void onDurationUpdated(int durationMillis) {
+ public void onDurationUpdated(long durationMillis) {
// Set the progress update interval based on the screen height/width, since there's no point
// in updating the progress bar more frequently than what the user can see.
// getDisplayMetrics() is dependent on the current orientation, so we need to get the max
@@ -415,7 +414,7 @@ public class NotificationTransportControl
}
@Override
- public void onPositionChanged(int positionMillis) {
+ public void onPositionChanged(long positionMillis) {
RemoteVideoInfo videoInfo = new RemoteVideoInfo(getVideoInfo());
videoInfo.currentTimeMillis = positionMillis;
setVideoInfo(videoInfo);

Powered by Google App Engine
This is Rietveld 408576698