@SystemApi public void suspend() { try { mUpdateEngine.suspend(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
@SystemApi public void resetStatus() { try { mUpdateEngine.resetStatus(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
@SystemApi public void applyPayload(String url, long offset, long size, String[] headerKeyValuePairs) { try { mUpdateEngine.applyPayload(url, offset, size, headerKeyValuePairs); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }
@SystemApi public boolean bind(final UpdateEngineCallback callback, final Handler handler) { IUpdateEngineCallback updateEngineCallback = new IUpdateEngineCallback.Stub() { @Override public void onStatusUpdate(final int status, final float percent) { if (handler != null) { handler.post( new Runnable() { @Override public void run() { callback.onStatusUpdate(status, percent); } }); } else { callback.onStatusUpdate(status, percent); } } @Override public void onPayloadApplicationComplete(final int errorCode) { if (handler != null) { handler.post( new Runnable() { @Override public void run() { callback.onPayloadApplicationComplete(errorCode); } }); } else { callback.onPayloadApplicationComplete(errorCode); } } }; try { return mUpdateEngine.bind(updateEngineCallback); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } }