@Override public void handleMessage(Message msg) { Object response; try { switch (msg.what) { case MSG_PROVISION: response = callback.executeProvisionRequest(uuid, (ProvisionRequest) msg.obj); break; case MSG_KEYS: response = callback.executeKeyRequest(uuid, (KeyRequest) msg.obj); break; default: throw new RuntimeException(); } } catch (Exception e) { response = e; } postResponseHandler.obtainMessage(msg.what, response).sendToTarget(); }
@Override public void handleMessage(Message msg) { Object response; try { switch (msg.what) { case MSG_PROVISION: response = callback.executeProvisionRequest(uuid, (ProvisionRequest) msg.obj); break; case MSG_KEYS: response = callback.executeKeyRequest(uuid, (KeyRequest) msg.obj); break; default: throw new RuntimeException(); } } catch (Exception e) { if (maybeRetryRequest(msg)) { return; } response = e; } postResponseHandler.obtainMessage(msg.what, response).sendToTarget(); }
private void postProvisionRequest() { if (provisioningInProgress) { return; } provisioningInProgress = true; ProvisionRequest request = mediaDrm.getProvisionRequest(); postRequestHandler.obtainMessage(MSG_PROVISION, request).sendToTarget(); }
@Override public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException { String url = request.getDefaultUrl() + "&signedRequest=" + new String(request.getData()); return executePost(dataSourceFactory, url, new byte[0], null); }
@Override public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException { String url = request.getDefaultUrl() + "&signedRequest=" + new String(request.getData()); return executePost(url, new byte[0], null); }
@Override public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException { throw new UnsupportedOperationException(); }
public void provision() { ProvisionRequest request = mediaDrm.getProvisionRequest(); postRequestHandler.obtainMessage(MSG_PROVISION, request, true).sendToTarget(); }
/** * Executes a provisioning request. * * @param uuid The UUID of the content protection scheme. * @param request The request. * @return The response data. * @throws Exception If an error occurred executing the request. */ byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws Exception;