Example usage for android.os RemoteException printStackTrace

List of usage examples for android.os RemoteException printStackTrace

Introduction

In this page you can find the example usage for android.os RemoteException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void svcStartForeground() {
    if (mSvcClient != null) {
        try {//  w w w .j  a v  a  2s  .  com
            mSvcClient.aidlStartForeground();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void svcStopForeground(boolean clear) {
    if (mSvcClient != null) {
        try {/* w  w  w .  j ava  2 s .  c o  m*/
            mSvcClient.aidlStopForeground(clear);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

final private void unsetCallbackListener() {
    if (mSvcClient != null) {
        try {/*www  .  j a  va  2s .co  m*/
            mSvcClient.removeCallBack(mSvcCallbackStub);
        } catch (RemoteException e) {
            e.printStackTrace();
            util.addDebugLogMsg(0, "E", "unsetCallbackListener error :" + e.toString());
        }
    }
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void clearScreenOn() {
    try {/*from w w w.jav  a  2 s  . co m*/
        mSvcClient.aidlRelWakeLock();
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    if (mDimScreenWakelock.isHeld()) {
        util.addDebugLogMsg(1, "I", "Dim screen wakelock released");
        mDimScreenWakelock.release();
    } else {
        util.addDebugLogMsg(1, "I", "Dim screen wakelock not relased, because Wakelock not acquired");
    }
    //      if (mGp.settingScreenOnEnabled) {
    //      }
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void setScreenOn() {
    try {//  ww  w  .j a v a 2  s . c  om
        mSvcClient.aidlAcqWakeLock();
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    if (!mGp.settingScreenOnOption.equals(GlobalParameters.KEEP_SCREEN_ON_DISABLED)) {
        if (mGp.settingScreenOnOption.equals(GlobalParameters.KEEP_SCREEN_ON_ALWAYS)
                || !isKeyguardEffective(mContext)) {
            if (!mDimScreenWakelock.isHeld()) {
                mDimScreenWakelock.acquire();
                util.addDebugLogMsg(1, "I", "Dim screen wakelock acquired");
            } else {
                util.addDebugLogMsg(1, "I",
                        "Dim screen wakelock not acquired, because Wakelock already acquired");
            }
        } else {
            util.addDebugLogMsg(1, "I", "Dim screen wakelock not acquired, because screen is alread locked");
        }
    }
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void closeService() {

    util.addDebugLogMsg(1, "I", "closeService entered");

    if (mSvcConnection != null) {
        try {/* w w w. ja v  a  2 s. com*/
            mSvcClient.aidlStopService();
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        mSvcClient = null;
        unbindService(mSvcConnection);
        mSvcConnection = null;
        //          Log.v("","close service");
    }
    Intent intent = new Intent(this, SMBSyncService.class);
    stopService(intent);
}

From source file:com.sentaroh.android.SMBSync2.ActivityMain.java

private void syncThreadStarted() {
    util.addDebugMsg(1, "I", "startSyncThread entered");
    setUiDisabled();/*  w w w . j a v  a  2  s  .  c o m*/
    mGp.progressSpinView.setVisibility(LinearLayout.VISIBLE);
    mGp.progressSpinView.setBackgroundColor(mGp.themeColorList.dialog_msg_background_color);
    mGp.progressSpinView.bringToFront();
    mGp.progressSpinSyncprof.setVisibility(TextView.VISIBLE);
    mGp.progressSpinCancel.setText(getString(R.string.msgs_progress_spin_dlg_sync_cancel));
    mGp.progressSpinCancel.setEnabled(true);
    // CANCEL?
    mGp.progressSpinCancelListener = new View.OnClickListener() {
        public void onClick(View v) {
            NotifyEvent ntfy = new NotifyEvent(mContext);
            ntfy.setListener(new NotifyEventListener() {
                @Override
                public void positiveResponse(Context c, Object[] o) {
                    try {
                        mSvcClient.aidlCancelSyncTask();
                    } catch (RemoteException e) {
                        e.printStackTrace();
                    }
                    mGp.progressSpinCancel.setText(getString(R.string.msgs_progress_dlg_canceling));
                    mGp.progressSpinCancel.setEnabled(false);
                }

                @Override
                public void negativeResponse(Context c, Object[] o) {
                }
            });
            commonDlg.showCommonDialog(true, "W", getString(R.string.msgs_sync_cancel_confirm), "", ntfy);
        }
    };
    mGp.progressSpinCancel.setOnClickListener(mGp.progressSpinCancelListener);

    mGp.msgListView.setFastScrollEnabled(false);

    SchedulerUtil.setSchedulerInfo(mGp, mContext, null);

    LogUtil.flushLog(mContext, mGp);
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void startMirrorTask(ArrayList<MirrorIoParmList> alp) {
    final LinearLayout ll_spin = (LinearLayout) findViewById(R.id.profile_progress_spin);
    final Button btnCancel = (Button) findViewById(R.id.profile_progress_spin_btn_cancel);
    ll_spin.setVisibility(LinearLayout.VISIBLE);
    ll_spin.setBackgroundColor(Color.BLACK);
    ll_spin.bringToFront();/*from   www. ja  va 2 s.co m*/

    btnCancel.setText(getString(R.string.msgs_progress_spin_dlg_sync_cancel));
    btnCancel.setEnabled(true);
    // CANCEL?
    btnCancel.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            try {
                mSvcClient.aidlCancelThread();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
            btnCancel.setText(getString(R.string.msgs_progress_dlg_canceling));
            btnCancel.setEnabled(false);
            mGp.settingAutoTerm = false;
        }
    });

    mGp.msgListView.setFastScrollEnabled(false);

    mGp.mirrorIoParms = alp;

    setUiDisabled();
    mGp.mirrorThreadActive = true;
    try {
        mSvcClient.aidlStartThread();
    } catch (RemoteException e) {
        e.printStackTrace();
    }
    setScreenOn();
    acqWifiLock();

}

From source file:com.sentaroh.android.SMBSync2.ActivityMain.java

private void showConfirmDialog(String fp, String method) {
    util.addDebugMsg(1, "I", "showConfirmDialog entered");
    mGp.confirmDialogShowed = true;//from  w w  w  . j a v  a 2s  .  c om
    mGp.confirmDialogFilePath = fp;
    mGp.confirmDialogMethod = method;
    final NotifyEvent ntfy = new NotifyEvent(mContext);
    ntfy.setListener(new NotifyEventListener() {
        @Override
        public void positiveResponse(Context c, Object[] o) {
            mGp.confirmDialogShowed = false;
            try {
                mSvcClient.aidlConfirmReply((Integer) o[0]);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
            mGp.confirmYesListener = null;
            mGp.confirmYesAllListener = null;
            mGp.confirmNoListener = null;
            mGp.confirmNoAllListener = null;
            mGp.confirmCancelListener = null;
            mGp.confirmCancel.setOnClickListener(null);
            mGp.confirmYes.setOnClickListener(null);
            mGp.confirmYesAll.setOnClickListener(null);
            mGp.confirmNo.setOnClickListener(null);
            mGp.confirmNoAll.setOnClickListener(null);
        }

        @Override
        public void negativeResponse(Context c, Object[] o) {
            mGp.confirmDialogShowed = false;
            try {
                mSvcClient.aidlConfirmReply((Integer) o[0]);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
            mGp.confirmYesListener = null;
            mGp.confirmYesAllListener = null;
            mGp.confirmNoListener = null;
            mGp.confirmNoAllListener = null;
            mGp.confirmCancelListener = null;
            mGp.confirmCancel.setOnClickListener(null);
            mGp.confirmYes.setOnClickListener(null);
            mGp.confirmYesAll.setOnClickListener(null);
            mGp.confirmNo.setOnClickListener(null);
            mGp.confirmNoAll.setOnClickListener(null);
        }
    });

    mGp.confirmView.setVisibility(LinearLayout.VISIBLE);
    mGp.confirmView.setBackgroundColor(mGp.themeColorList.dialog_msg_background_color);
    mGp.confirmView.bringToFront();
    String msg_text = "";
    if (method.equals(SMBSYNC_CONFIRM_REQUEST_COPY)) {
        msg_text = String.format(getString(R.string.msgs_mirror_confirm_copy_confirm), fp);
    } else if (method.equals(SMBSYNC_CONFIRM_REQUEST_DELETE_FILE)) {
        msg_text = String.format(getString(R.string.msgs_mirror_confirm_delete_file_confirm), fp);
    } else if (method.equals(SMBSYNC_CONFIRM_REQUEST_DELETE_DIR)) {
        msg_text = String.format(getString(R.string.msgs_mirror_confirm_delete_dir_confirm), fp);
    }
    mGp.confirmMsg.setText(msg_text);

    // Yes?
    mGp.confirmYesListener = new View.OnClickListener() {
        public void onClick(View v) {
            mGp.confirmView.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(true, new Object[] { SMBSYNC_CONFIRM_RESP_YES });
        }
    };
    mGp.confirmYes.setOnClickListener(mGp.confirmYesListener);
    // YesAll?
    mGp.confirmYesAllListener = new View.OnClickListener() {
        public void onClick(View v) {
            mGp.confirmView.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(true, new Object[] { SMBSYNC_CONFIRM_RESP_YESALL });
        }
    };
    mGp.confirmYesAll.setOnClickListener(mGp.confirmYesAllListener);
    // No?
    mGp.confirmNoListener = new View.OnClickListener() {
        public void onClick(View v) {
            mGp.confirmView.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(false, new Object[] { SMBSYNC_CONFIRM_RESP_NO });
        }
    };
    mGp.confirmNo.setOnClickListener(mGp.confirmNoListener);
    // NoAll?
    mGp.confirmNoAllListener = new View.OnClickListener() {
        public void onClick(View v) {
            mGp.confirmView.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(false, new Object[] { SMBSYNC_CONFIRM_RESP_NOALL });
        }
    };
    mGp.confirmNoAll.setOnClickListener(mGp.confirmNoAllListener);
    // Task cancel?
    mGp.confirmCancelListener = new View.OnClickListener() {
        public void onClick(View v) {
            mGp.confirmView.setVisibility(LinearLayout.GONE);
            //            try {
            //               mSvcClient.aidlCancelThread();
            //            } catch (RemoteException e) {
            //               e.printStackTrace();
            //            }
            //            mGp.progressSpinCancel.performClick();
            ntfy.notifyToListener(false, new Object[] { SMBSYNC_CONFIRM_RESP_CANCEL });
        }
    };
    mGp.confirmCancel.setOnClickListener(mGp.confirmCancelListener);
}

From source file:com.sentaroh.android.SMBSync.SMBSyncMain.java

private void showConfirmDialog(String fp, String method) {

    util.addDebugLogMsg(1, "I", "showConfirmDialog entered");
    final NotifyEvent ntfy = new NotifyEvent(mContext);
    ntfy.setListener(new NotifyEventListener() {
        @Override//from   w  w w  .  j  a  va2  s  .  c o m
        public void positiveResponse(Context c, Object[] o) {
            try {
                mSvcClient.aidlConfirmResponse((Integer) o[0]);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }

        @Override
        public void negativeResponse(Context c, Object[] o) {
            try {
                mSvcClient.aidlConfirmResponse((Integer) o[0]);
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    });

    final LinearLayout ll_confirm = (LinearLayout) findViewById(R.id.profile_confirm);
    ll_confirm.setVisibility(LinearLayout.VISIBLE);
    ll_confirm.setBackgroundColor(Color.BLACK);
    ll_confirm.bringToFront();
    TextView dlg_title = (TextView) findViewById(R.id.copy_delete_confirm_title);
    TextView dlg_msg = (TextView) findViewById(R.id.copy_delete_confirm_msg);
    dlg_title.setText(mContext.getString(R.string.msgs_common_dialog_warning));
    dlg_title.setTextColor(Color.YELLOW);
    String msg_text = "";
    if (method.equals(SMBSYNC_CONFIRM_FOR_COPY)) {
        msg_text = String.format(getString(R.string.msgs_mirror_confirm_copy_confirm), fp);
    } else {
        msg_text = String.format(getString(R.string.msgs_mirror_confirm_delete_confirm), fp);
    }
    dlg_msg.setText(msg_text);

    showNotificationMsg(msg_text);

    if (method.equals(SMBSYNC_CONFIRM_FOR_COPY))
        dlg_msg.setText(String.format(getString(R.string.msgs_mirror_confirm_copy_confirm), fp));
    else
        dlg_msg.setText(String.format(getString(R.string.msgs_mirror_confirm_delete_confirm), fp));

    Button btnYes = (Button) findViewById(R.id.copy_delete_confirm_yes);
    Button btnYesAll = (Button) findViewById(R.id.copy_delete_confirm_yesall);
    final Button btnNo = (Button) findViewById(R.id.copy_delete_confirm_no);
    Button btnNoAll = (Button) findViewById(R.id.copy_delete_confirm_noall);
    Button btnTaskCancel = (Button) findViewById(R.id.copy_delete_confirm_task_cancel);

    // Yes?
    btnYes.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            ll_confirm.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(true, new Object[] { SMBSYNC_CONFIRM_RESP_YES });
        }
    });
    // YesAll?
    btnYesAll.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            ll_confirm.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(true, new Object[] { SMBSYNC_CONFIRM_RESP_YESALL });
        }
    });
    // No?
    btnNo.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            ll_confirm.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(false, new Object[] { SMBSYNC_CONFIRM_RESP_NO });
        }
    });
    // NoAll?
    btnNoAll.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            ll_confirm.setVisibility(LinearLayout.GONE);
            ntfy.notifyToListener(false, new Object[] { SMBSYNC_CONFIRM_RESP_NOALL });
        }
    });
    // Task cancel?
    btnTaskCancel.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            ll_confirm.setVisibility(LinearLayout.GONE);
            try {
                mSvcClient.aidlCancelThread();
            } catch (RemoteException e) {
                e.printStackTrace();
            }
            ntfy.notifyToListener(false, new Object[] { SMBSYNC_CONFIRM_RESP_NOALL });
        }
    });
}