List of usage examples for android.os RemoteException printStackTrace
public void printStackTrace()
From source file:com.soomla.store.billing.tapclash.TapClashIabHelper.java
/** * See parent// ww w .j av a 2 s . co m */ protected void startSetupInner() { mServiceConn = new ServiceConnection() { @Override public void onServiceDisconnected(ComponentName name) { SoomlaUtils.LogDebug(TAG, "Billing service disconnected."); mService = null; } @Override public void onServiceConnected(ComponentName name, IBinder service) { SoomlaUtils.LogDebug(TAG, "Billing service connected."); mService = IInAppBillingService.Stub.asInterface(service); String packageName = SoomlaApp.getAppContext().getPackageName(); try { SoomlaUtils.LogDebug(TAG, "Checking for in-app billing 3 support."); // check for in-app billing v3 support int response = mService.isBillingSupported(3, packageName, ITEM_TYPE_INAPP); if (response != IabResult.BILLING_RESPONSE_RESULT_OK) { setupFailed(new IabResult(response, "Error checking for billing v3 support.")); return; } SoomlaUtils.LogDebug(TAG, "In-app billing version 3 supported for " + packageName); setupSuccess(); } catch (RemoteException e) { setupFailed(new IabResult(IabResult.IABHELPER_REMOTE_EXCEPTION, "RemoteException while setting up in-app billing.")); e.printStackTrace(); } } }; Intent serviceIntent = new Intent("com.gametree.vending.billing.InAppBillingService.BIND"); serviceIntent.setPackage("com.gametree.estore"); List<ResolveInfo> intentServices = SoomlaApp.getAppContext().getPackageManager() .queryIntentServices(serviceIntent, 0); if (intentServices != null && !intentServices.isEmpty()) { // service available to handle that Intent SoomlaApp.getAppContext().bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE); } else { // no service available to handle that Intent setupFailed(new IabResult(IabResult.BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE, "Billing service unavailable on device.")); } }
From source file:com.sentaroh.android.TaskAutomation.ActivityTaskStatus.java
private void stopSvcSchduler() { util.addDebugMsg(1, "I", "stopSvcSchduler entered"); if (svcClientCallback != null) { try {//www . j a va 2s. com svcServer.removeCallBack(svcClientCallback); svcClientCallback = null; } catch (RemoteException e) { e.printStackTrace(); util.addLogMsg("E", "removeListener error :", e.toString()); } } unbindService(svcConnScheduler); }
From source file:com.sentaroh.android.TaskAutomation.ActivityTaskStatus.java
private void setSchedulerStatus() { TextView dlg_msg = (TextView) mainDialog.findViewById(R.id.task_status_dlg_msg); String msg_text = "", msg_pref = ""; if (!envParms.settingEnableScheduler) { msg_text = msg_pref + getString(R.string.msgs_main_task_scheduler_not_running); msg_pref = "\n"; }/* ww w . j ava 2s .c o m*/ try { int cnt = svcServer.aidlGetTaskListCount(); if (cnt == 0) { msg_text += msg_pref + getString(R.string.msgs_main_task_scheduler_no_valid_profile); msg_pref = "\n"; } } catch (RemoteException e) { e.printStackTrace(); } if (msg_text.equals("")) { dlg_msg.setVisibility(TextView.GONE); } else { dlg_msg.setVisibility(TextView.VISIBLE); dlg_msg.setText(msg_text); } }
From source file:com.sentaroh.android.TaskAutomation.ActivityTaskStatus.java
final private void setCallbackListener() { final Handler handler = new Handler(); util.addDebugMsg(1, "I", "setCallbackListener entered"); svcClientCallback = new ISchedulerCallback.Stub() { final public void notifyToClient(String resp_time, final String resp, final String grp, final String task, final String action, String dialog_id, final int atc, final int resp_cd, final String msg) throws RemoteException { if (envParms.settingDebugLevel >= 2) util.addDebugMsg(1, "I", "Notify received ", "Resp=", resp, ", Task=", task, ", action=", action, ", dialog_id=", dialog_id); handler.post(new Runnable() { @Override//from w w w. ja v a2 s . co m public void run() { updateActiveTaskByResponse(atc, resp, grp, task); setSchedulerStatus(); } }); } }; try { svcServer.setCallBack(svcClientCallback); } catch (RemoteException e) { e.printStackTrace(); util.addLogMsg("E", "setCallbackListener error :", e.toString()); } }
From source file:com.sentaroh.android.TaskAutomation.ActivityTaskStatus.java
private ArrayList<TaskStatusActiveTaskListItem> getActiveTaskList(int atc) { ArrayList<TaskStatusActiveTaskListItem> tal = new ArrayList<TaskStatusActiveTaskListItem>(); try {//ww w . j ava 2 s .c o m if (atc != 0) { String[] atl = svcServer.aidlGetActiveTaskList(); if (atl != null) { TaskStatusActiveTaskListItem tsatli; for (int i = 0; i < atl.length; i++) { String[] atl_item = atl[i].split("\t"); if (atl_item != null) { tsatli = new TaskStatusActiveTaskListItem(); tsatli.profile_grp = atl_item[0]; tsatli.event_name = atl_item[1]; tsatli.task_name = atl_item[2]; tsatli.start_time = atl_item[4]; tsatli.task_active_state = atl_item[5]; tal.add(tsatli); } } } } } catch (RemoteException e) { e.printStackTrace(); } return tal; }
From source file:com.sentaroh.android.TaskAutomation.ActivityTaskStatus.java
private void setCancelBtnListener() { NotifyEvent ntfy = new NotifyEvent(this); ntfy.setListener(new NotifyEventListener() { @Override/*from ww w. j av a2 s . com*/ public void positiveResponse(Context c, Object[] o) { try { svcServer.aidlCancelSpecificTask((String) o[0], (String) o[1]); } catch (RemoteException e) { e.printStackTrace(); } } @Override public void negativeResponse(Context c, Object[] o) { } }); statusAdapter.setCancelBtnListener(ntfy); }
From source file:com.sentaroh.android.TaskAutomation.ActivityTaskStatus.java
private ArrayList<TaskStatusTaskHistoryListItem> getTaskHistoryList() { ArrayList<TaskStatusTaskHistoryListItem> thl = new ArrayList<TaskStatusTaskHistoryListItem>(); try {//from w w w .j av a 2 s . c o m String[] thsal = svcServer.aidlGetTaskHistoryList(); if (thsal != null) { TaskStatusTaskHistoryListItem tsatli; for (int i = 0; i < thsal.length; i++) { String[] atl_item = thsal[i].split("\t"); if (atl_item != null) { tsatli = new TaskStatusTaskHistoryListItem(); tsatli.end_time = atl_item[0]; tsatli.task_status = atl_item[1]; tsatli.result = atl_item[2]; tsatli.profile_grp = atl_item[3]; tsatli.event_name = atl_item[4]; tsatli.task_name = atl_item[5]; if (atl_item.length > 6) tsatli.msg_text = atl_item[6]; else tsatli.msg_text = ""; thl.add(tsatli); } } } } catch (RemoteException e) { e.printStackTrace(); } return thl; }
From source file:com.chartboost.sdk.sample.cbtest.inappbilling.util.IabHelper.java
public int myconsume(String packageName, String token) { int response = -1; try {//from www . j a v a2 s .c o m response = mService.consumePurchase(3, packageName, token); } catch (RemoteException e) { e.printStackTrace(); } return response; }
From source file:com.nxp.ltsm.ltsmclient.LTSMCommunicator.java
/******************************************************* * *Closes currently opened Logical Channels * ********************************************************/ public static void closeLogicalChannel() { String TAG = "LTSMCommunicator:closeLogicalChannel"; Log.i(TAG, "Enter"); byte[] rData = new byte[0]; byte[] closeChannelCmd = new byte[] {}; channelCnt = Utils.loadInt("channelCnt", context); channelId = Utils.loadArray("channelId", context); isopened = Utils.loadArray("isopened", context); Log.i(TAG, "channelCnt : " + channelCnt); for (int cnt = 0; (cnt < channelCnt); cnt++) { if (isopened[cnt] == 1) { closeChannelCmd = new byte[] { (byte) channelId[cnt], (byte) 0x70, (byte) 0x80, (byte) channelId[cnt], (byte) 0x00 }; try { rData = exchangeApdu(closeChannelCmd); } catch (RemoteException e) { e.printStackTrace(); }/*from ww w . j av a2 s .c o m*/ if (rData == null) { Log.i(TAG, "exchangeApdu FAILED"); rData = Utils.createStatusCode(Data.SW_NO_DATA_RECEIVED); } else if (Utils.getSW(rData) == Data.SW_NO_ERROR) { Log.i(TAG, "Close Channe id : " + channelId[cnt] + "is SUCCESS"); channelCnt = channelCnt - 1; } else { Log.i(TAG, "Close Channe id : " + channelId[cnt] + "is Failed"); } } } Utils.saveInt(channelCnt, "channelCnt", context); try { closeConnection(); } catch (RemoteException e) { e.printStackTrace(); } Log.i(TAG, "Exit"); }
From source file:com.smithdtyler.prettygoodmusicplayer.MusicPlaybackService.java
private void sendUpdateToClients() { List<Messenger> toRemove = new ArrayList<Messenger>(); synchronized (mClients) { for (Messenger client : mClients) { Message msg = Message.obtain(null, MSG_SERVICE_STATUS); Bundle b = new Bundle(); if (songFile != null) { b.putString(PRETTY_SONG_NAME, Utils.getPrettySongName(songFile)); b.putString(PRETTY_ALBUM_NAME, songFile.getParentFile().getName()); b.putString(PRETTY_ARTIST_NAME, songFile.getParentFile().getParentFile().getName()); } else { // songFile can be null while we're shutting down. b.putString(PRETTY_SONG_NAME, " "); b.putString(PRETTY_ALBUM_NAME, " "); b.putString(PRETTY_ARTIST_NAME, " "); }/*w ww. j a v a 2 s . c om*/ b.putBoolean(IS_SHUFFLING, this._shuffle); if (mp.isPlaying()) { b.putInt(PLAYBACK_STATE, PlaybackState.PLAYING.ordinal()); } else { b.putInt(PLAYBACK_STATE, PlaybackState.PAUSED.ordinal()); } // We might not be able to send the position right away if mp is // still being created // so instead let's send the last position we knew about. if (mp.isPlaying()) { lastDuration = mp.getDuration(); lastPosition = mp.getCurrentPosition(); } b.putInt(TRACK_DURATION, lastDuration); b.putInt(TRACK_POSITION, lastPosition); msg.setData(b); try { client.send(msg); } catch (RemoteException e) { e.printStackTrace(); toRemove.add(client); } } for (Messenger remove : toRemove) { mClients.remove(remove); } } }