List of usage examples for android.os RemoteException printStackTrace
public void printStackTrace()
From source file:org.gege.caldavsyncadapter.caldav.entities.DavCalendar.java
/** * COMPAT: the serverurl (CAL_SYNC2) was not sored within a calendar. this fixes it. (see #98) * @param serverUrl the current serverurl * @return success of this function//w w w .j av a 2 s . c om */ private boolean correctServerUrl(String serverUrl) { boolean Result = false; Log.v(TAG, "correcting ServerUrl for calendar:" + this.getContentValueAsString(Calendars.CALENDAR_DISPLAY_NAME)); ContentValues mUpdateValues = new ContentValues(); mUpdateValues.put(DavCalendar.SERVERURL, serverUrl); try { mProvider.update(this.SyncAdapterCalendar(), mUpdateValues, null, null); Result = true; } catch (RemoteException e) { e.printStackTrace(); } return Result; }
From source file:com.smithdtyler.prettygoodmusicplayer.NowPlaying.java
private void playPause() { Log.d(TAG, "Play/Pause clicked..."); Message msg = Message.obtain(null, MusicPlaybackService.MSG_PLAYPAUSE); try {//from ww w . ja va2s. co m Log.i(TAG, "Sending a request to start playing!"); mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } }
From source file:com.smithdtyler.prettygoodmusicplayer.NowPlaying.java
private void next() { Log.d(TAG, "next..."); Message msg = Message.obtain(null, MusicPlaybackService.MSG_NEXT); try {/*from w w w .j a v a 2s . co m*/ Log.i(TAG, "SEnding a request to go to next!"); mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } }
From source file:com.smithdtyler.prettygoodmusicplayer.NowPlaying.java
public void previous() { Log.d(TAG, "Previous clicked..."); Message msg = Message.obtain(null, MusicPlaybackService.MSG_PREVIOUS); try {//from w ww .ja va2s .co m Log.i(TAG, "Sending a request to go to previous!"); mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } }
From source file:com.smithdtyler.prettygoodmusicplayer.NowPlaying.java
public void jumpBack() { Log.d(TAG, "JumpBack clicked..."); Message msg = Message.obtain(null, MusicPlaybackService.MSG_JUMPBACK); try {/*from w w w .ja v a 2s. c o m*/ Log.i(TAG, "Sending a request to jump back!"); mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } }
From source file:com.smithdtyler.prettygoodmusicplayer.NowPlaying.java
public void toggleShuffle() { Log.d(TAG, "Shuffle clicked..."); Message msg = Message.obtain(null, MusicPlaybackService.MSG_TOGGLE_SHUFFLE); try {/* w ww .j a va 2 s .com*/ Log.i(TAG, "Sending a request to toggle shuffle!"); mService.send(msg); } catch (RemoteException e) { e.printStackTrace(); } }
From source file:org.gege.caldavsyncadapter.caldav.entities.DavCalendar.java
/** * there is no corresponding calendar on server side. time to delete this calendar on android side. * @return // w ww . j av a 2 s . com */ public boolean deleteAndroidCalendar() { boolean Result = false; String mSelectionClause = "(" + Calendars._ID + " = ?)"; int calendarId = this.getAndroidCalendarId(); String[] mSelectionArgs = { Long.toString(calendarId) }; int CountDeleted = 0; try { CountDeleted = mProvider.delete(this.SyncAdapter(), mSelectionClause, mSelectionArgs); Log.i(TAG, "Calendar deleted: " + String.valueOf(calendarId)); this.mNotifyList.add(this.getAndroidCalendarUri()); Result = true; } catch (RemoteException e) { e.printStackTrace(); } Log.d(TAG, "Android Calendars deleted: " + Integer.toString(CountDeleted)); return Result; }
From source file:com.example.activitydemo.app.service.GameService.java
private void connectGoogleApiClient() { synchronized (mBinderService) { if (mClient == null) { mClient = GooglePlayServicesActivity.getGoogleApiClientBuilder(this) .addConnectionCallbacks(mBinderService).addOnConnectionFailedListener(mBinderService) .build();/*w w w . java 2 s . com*/ } if (!(mClient.isConnected() || mClient.isConnecting())) { mClient.connect(); } else { if (mBinderService.isConnected()) { try { int state = inGame() ? STATE_IN_GAME : STATE_PRE_GAME; mBinderService.mCallbacks.onConnected(state); } catch (RemoteException e) { e.printStackTrace(); } } } } }
From source file:cx.ring.fragments.CallFragment.java
private void updateSecurityDisplay() { //First we check if all participants use a security layer. boolean secure_call = !getConference().getParticipants().isEmpty(); for (SipCall c : getConference().getParticipants()) secure_call &= c instanceof SecureSipCall && ((SecureSipCall) c).isSecure(); securityIndicator.setVisibility(secure_call ? View.VISIBLE : View.GONE); if (!secure_call) return;//from w ww . java2s .c o m Log.i(TAG, "Enable security display"); if (getConference().hasMultipleParticipants()) { //TODO What layout should we put? } else { final SecureSipCall secured = (SecureSipCall) getConference().getParticipants().get(0); switch (secured.displayModule()) { case SecureSipCall.DISPLAY_GREEN_LOCK: Log.i(TAG, "DISPLAY_GREEN_LOCK"); showLock(R.drawable.green_lock); break; case SecureSipCall.DISPLAY_RED_LOCK: Log.i(TAG, "DISPLAY_RED_LOCK"); showLock(R.drawable.red_lock); break; case SecureSipCall.DISPLAY_CONFIRM_SAS: final Button sas = (Button) mSecuritySwitch.findViewById(R.id.confirm_sas); sas.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { mCallbacks.getRemoteService().confirmSAS(secured.getCallId()); showLock(R.drawable.green_lock); } catch (RemoteException e) { e.printStackTrace(); } } }); mSecuritySwitch.setDisplayedChild(0); mSecuritySwitch.setVisibility(View.VISIBLE); break; case SecureSipCall.DISPLAY_NONE: break; } } }
From source file:com.turbulenz.turbulenz.googlepayment.java
void threadQueryPurchases(final long context) { String continueToken = null;// w ww. j a v a2 s . c o m do { Bundle ownedItems; try { ownedItems = mService.getPurchases(3, mActivity.getPackageName(), ITEM_TYPE_INAPP, continueToken); } catch (RemoteException e) { _error("threadQueryPurchases: remote exception: " + e); e.printStackTrace(); sendPurchaseInfoError(context, "failed to communicate " + "with Google Play"); return; } int response = getResponseCodeFromBundle(ownedItems); if (BILLING_RESPONSE_RESULT_OK != response) { _error("doQueryPurchases: !! error retrieving purchased SKUs"); // TODO: Should we grab something fom saved data here? sendPurchaseInfoError(context, "error getting purchase data"); return; } if (!ownedItems.containsKey(RESPONSE_INAPP_ITEM_LIST) || !ownedItems.containsKey(RESPONSE_INAPP_PURCHASE_DATA_LIST) || !ownedItems.containsKey(RESPONSE_INAPP_SIGNATURE_LIST)) { _error("doQueryPurchases: !! missign fields in response"); sendPurchaseInfoError(context, "response missing some fields"); return; } ArrayList<String> ownedSkus = ownedItems.getStringArrayList(RESPONSE_INAPP_ITEM_LIST); ArrayList<String> purchaseData = ownedItems.getStringArrayList(RESPONSE_INAPP_PURCHASE_DATA_LIST); ArrayList<String> signatureData = ownedItems.getStringArrayList(RESPONSE_INAPP_SIGNATURE_LIST); final int numSKUs = purchaseData.size(); _print("doQueryPurchases: " + numSKUs + " SKUs:"); for (int itemIdx = 0; itemIdx < numSKUs; ++itemIdx) { final String sku = ownedSkus.get(itemIdx); final String data = purchaseData.get(itemIdx); final String sig = signatureData.get(itemIdx); try { JSONObject o = new JSONObject(data); //o.optString("productId"); final String googleToken = o.optString("token", o.optString("purchaseToken")); final String devPayload = o.optString("developerPayload"); _print(" - " + sku); _log(" - (data:" + data + ", sig: " + sig + ")"); sendPurchaseInfo(context, sku, data, googleToken, devPayload, sig); } catch (JSONException e) { _error("threadQueryPurchases: bad JSON: " + data); sendPurchaseInfoError(context, "error in purchase data"); return; } } continueToken = ownedItems.getString(INAPP_CONTINUATION_TOKEN); _log("doQueryPurchases: got continue token: " + continueToken); } while (!TextUtils.isEmpty(continueToken)); sendPurchaseInfoTerminator(context); }