private void onResult(IAccountManagerResponse response, Bundle result) { try { response.onResult(result); } catch (RemoteException e) { // if the caller is dead then there is no one to care about remote // exceptions e.printStackTrace(); } }
public static <T> T crash(RemoteException e) throws RuntimeException { e.printStackTrace(); if (VirtualCore.get().isVAppProcess()) { Process.killProcess(Process.myPid()); System.exit(0); } throw new DeadServerException(e); }
public void killAllApps() { try { getService().killAllApps(); } catch (RemoteException e) { e.printStackTrace(); } }
public void registerProcessObserver(IProcessObserver observer) { try { getService().registerProcessObserver(observer); } catch (RemoteException e) { e.printStackTrace(); } }
public void killAppByPkg(String pkg, int userId) { try { getService().killAppByPkg(pkg, userId); } catch (RemoteException e) { e.printStackTrace(); } }
public void unregisterProcessObserver(IProcessObserver observer) { try { getService().unregisterProcessObserver(observer); } catch (RemoteException e) { e.printStackTrace(); } }
public static void addService(String name, IBinder service) { IServiceFetcher fetcher = getServiceFetcher(); if (fetcher != null) { try { fetcher.addService(name, service); } catch (RemoteException e) { e.printStackTrace(); } } }
public void clearAppRequestListener() { try { getService().clearAppRequestListener(); } catch (RemoteException e) { e.printStackTrace(); } }
public void clearPassword(Account account) { try { getRemote().clearPassword(VUserHandle.myUserId(), account); } catch (RemoteException e) { e.printStackTrace(); } }
public void getAuthToken(IAccountManagerResponse response, Account account, String authTokenType, boolean notifyOnAuthFailure, boolean expectActivityLaunch, Bundle loginOptions) { try { getRemote().getAuthToken(VUserHandle.myUserId(), response, account, authTokenType, notifyOnAuthFailure, expectActivityLaunch, loginOptions); } catch (RemoteException e) { e.printStackTrace(); } }
@Override public void pauseAllTasks() { if (!isConnected()) { DownloadServiceNotConnectedHelper.pauseAllTasks(); return; } try { getService().pauseAllTasks(); } catch (RemoteException e) { e.printStackTrace(); } }
@Override public boolean setMaxNetworkThreadCount(int count) { if (!isConnected()) { return DownloadServiceNotConnectedHelper.setMaxNetworkThreadCount(count); } try { return getService().setMaxNetworkThreadCount(count); } catch (RemoteException e) { e.printStackTrace(); } return false; }
@Override public boolean pause(final int id) { if (!isConnected()) { return DownloadServiceNotConnectedHelper.pause(id); } try { return getService().pause(id); } catch (RemoteException e) { e.printStackTrace(); } return false; }
@Override public boolean clearTaskData(int id) { if (!isConnected()) { return DownloadServiceNotConnectedHelper.clearTaskData(id); } try { return getService().clearTaskData(id); } catch (RemoteException e) { e.printStackTrace(); } return false; }
@Override public boolean isDownloading(final String url, final String path) { if (!isConnected()) { return DownloadServiceNotConnectedHelper.isDownloading(url, path); } try { return getService().checkDownloading(url, path); } catch (RemoteException e) { e.printStackTrace(); } return false; }
@Override public void startForeground(int notificationId, Notification notification) { if (!isConnected()) { DownloadServiceNotConnectedHelper.startForeground(notificationId, notification); return; } try { getService().startForeground(notificationId, notification); } catch (RemoteException e) { e.printStackTrace(); } }
@Override public byte getStatus(final int id) { if (!isConnected()) { return DownloadServiceNotConnectedHelper.getStatus(id); } byte status = FileDownloadStatus.INVALID_STATUS; try { status = getService().getStatus(id); } catch (RemoteException e) { e.printStackTrace(); } return status; }
@Override public long getTotal(final int id) { if (!isConnected()) { return DownloadServiceNotConnectedHelper.getTotal(id); } long val = 0; try { val = getService().getTotal(id); } catch (RemoteException e) { e.printStackTrace(); } return val; }
@Override public void clearAllTaskData() { if (!isConnected()) { DownloadServiceNotConnectedHelper.clearAllTaskData(); return; } try { getService().clearAllTaskData(); } catch (RemoteException e) { e.printStackTrace(); } } }
@Override public long getSofar(final int id) { if (!isConnected()) { return DownloadServiceNotConnectedHelper.getSofar(id); } long val = 0; try { val = getService().getSofar(id); } catch (RemoteException e) { e.printStackTrace(); } return val; }