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

Unified Diff: dart/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDevice.java

Issue 328663002: Version 1.5.0-dev.4.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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: dart/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDevice.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDevice.java (revision 0)
+++ dart/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDevice.java (revision 0)
@@ -0,0 +1,46 @@
+package com.google.dart.tools.core.mobile;
+
+/**
+ * Class representing a connected android device as returned by
+ * {@link AndroidDebugBridge#getConnectedDevice()}.
+ */
+public class AndroidDevice {
+
+ public static boolean isEqual(AndroidDevice d1, AndroidDevice d2) {
+ return d1 == null ? d2 == null : d1.equals(d2);
+ }
+
+ private String deviceId;
+
+ private boolean authorized;
+
+ public AndroidDevice(String deviceId, boolean authorized) {
+ if (deviceId == null) {
+ throw new IllegalArgumentException();
+ }
+ this.deviceId = deviceId;
+ this.authorized = authorized;
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other instanceof AndroidDevice) {
+ AndroidDevice d = (AndroidDevice) other;
+ return deviceId.equals(d.getDeviceId()) && authorized == d.isAuthorized();
+ }
+ return false;
+ }
+
+ public String getDeviceId() {
+ return deviceId;
+ }
+
+ @Override
+ public int hashCode() {
+ return deviceId.hashCode() + (authorized ? 1 : 0);
+ }
+
+ public boolean isAuthorized() {
+ return authorized;
+ }
+}
Property changes on: dart/editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/mobile/AndroidDevice.java
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « no previous file | dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/dartium/DartiumDebugIndexedValue.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698