Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
| index cf4db0ee9c5ccdb17fad492ffb38bb559f5a6cdc..628c80813d79b6f8fb539a8a79f2386ba749dca6 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/jni/JniInterface.java |
| @@ -18,7 +18,6 @@ import android.view.KeyEvent; |
| import android.view.View; |
| import android.widget.CheckBox; |
| import android.widget.TextView; |
| -import android.widget.Toast; |
|
Jamie
2014/03/05 20:51:31
Unused import.
|
| import org.chromium.base.CalledByNative; |
| import org.chromium.base.JNINamespace; |
| @@ -98,8 +97,29 @@ public class JniInterface { |
| public static Error fromValue(int value) { |
| return values()[value]; |
| } |
| + |
| + public int toResourceId() { |
|
Lambros
2014/03/05 23:36:54
Make this a public final member of the enum instea
Jamie
2014/03/06 01:29:32
I made it private instead, with an accessor for co
|
| + switch (this) { |
| + case PEER_IS_OFFLINE: |
| + return R.string.error_host_is_offline; |
| + case SESSION_REJECTED: |
| + case AUTHENTICATION_FAILED: |
| + return R.string.error_invalid_access_code; |
| + case INCOMPATIBLE_PROTOCOL: |
| + return R.string.error_incompatible_protocol; |
| + case HOST_OVERLOAD: |
| + return R.string.error_host_overload; |
| + case CHANNEL_CONNECTION_ERROR: |
| + case SIGNALING_ERROR: |
| + case SIGNALING_TIMEOUT: |
| + return R.string.error_p2p_failure; |
| + default: |
| + return R.string.error_unexpected; |
| + } |
| + } |
| } |
| + |
| /** |
| * Notified on connection state change. |
| * @param state The new connection state. |