Commit 02925c41 authored by Simeon Anfinrud's avatar Simeon Anfinrud Committed by Commit Bot

[Chromecast] Clean up lint warnings in CastWebContents*

This fixes Java Errorprone warnings for:
  * deprecation
  * ReferenceEquality

Bug: Internal b/70158727
Test: build cast_shell_java, observe
      that lint warning is gone.

Change-Id: If72602773455c2c1903ca478ecb77baf4624e82a
Reviewed-on: https://chromium-review.googlesource.com/807150Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Simeon Anfinrud <sanfin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521552}
parent 426afedd
...@@ -123,8 +123,8 @@ public class CastWebContentsActivity extends Activity { ...@@ -123,8 +123,8 @@ public class CastWebContentsActivity extends Activity {
protected void handleIntent(Intent intent) { protected void handleIntent(Intent intent) {
// Do not load the WebContents if we are simply bringing the same // Do not load the WebContents if we are simply bringing the same
// activity to the foreground. // activity to the foreground.
if (intent.getData() == null || mInstanceId == intent.getData().getPath()) { if (intent.getData() == null || mInstanceId.equals(intent.getData().getPath())) {
return; return;
} }
intent.setExtrasClassLoader(WebContents.class.getClassLoader()); intent.setExtrasClassLoader(WebContents.class.getClassLoader());
...@@ -357,7 +357,7 @@ public class CastWebContentsActivity extends Activity { ...@@ -357,7 +357,7 @@ public class CastWebContentsActivity extends Activity {
mHandler.postDelayed(new Runnable() { mHandler.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
if (currentInstanceId == mInstanceId) { if (currentInstanceId.equals(mInstanceId)) {
Log.d(TAG, "Finishing."); Log.d(TAG, "Finishing.");
finish(); finish();
} }
......
...@@ -93,6 +93,9 @@ public class CastWebContentsService extends Service { ...@@ -93,6 +93,9 @@ public class CastWebContentsService extends Service {
} }
// Sets webContents to be the currently displayed webContents. // Sets webContents to be the currently displayed webContents.
// TODO(thoren): Notification.Builder(Context) is deprecated in O. Use the (Context, String)
// constructor when CastWebContentsService starts supporting O.
@SuppressWarnings("deprecation")
private void showWebContents(WebContents webContents) { private void showWebContents(WebContents webContents) {
if (DEBUG) Log.d(TAG, "showWebContents"); if (DEBUG) Log.d(TAG, "showWebContents");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment