public void connect(KrollDict args) throws RuntimeException { if (device == null) { // this.getCapabilityToken(args.get("url").toString()); PendingIntentProxy proxy = (PendingIntentProxy) args.get("pendingIntent"); PendingIntent pendingIntent = proxy.getPendingIntent(); this.getCapabilityToken(args.get("url").toString(), pendingIntent); } if (args.containsKey("params") && args.get("params") instanceof HashMap) { HashMap<String, String> params = (HashMap<String, String>) args.get("params"); Map<String, String> parameters = new HashMap<String, String>(); for (String key : params.keySet()) { parameters.put(key, params.get(key).toString()); } connection = device.connect(parameters, null); } else { connection = device.connect(null, null); } }
public void login(KrollDict args) { Log.d(TAG, "loging in!"); PendingIntentProxy proxy = (PendingIntentProxy) args.get("pendingIntent"); PendingIntent pendingIntent = proxy.getPendingIntent(); this.getCapabilityToken(args.get("url").toString(), pendingIntent); }