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:org.yammp.app.MusicBrowserActivity.java

private void updateNowplaying() {
    if (mService == null)
        return;/*from  ww w  .j  av  a  2s.c o  m*/
    try {
        if (mService.getAudioId() > -1 || mService.getPath() != null) {
            setTitle(mService.getTrackName());
            if (mService.getArtistName() != null
                    && !MediaStore.UNKNOWN_STRING.equals(mService.getArtistName())) {
                mActionBar.setSubtitle(mService.getArtistName());
            } else if (mService.getAlbumName() != null
                    && !MediaStore.UNKNOWN_STRING.equals(mService.getAlbumName())) {
                mActionBar.setSubtitle(mService.getAlbumName());
            } else {
                mActionBar.setSubtitle(R.string.unknown_artist);
            }
        } else {
            setTitle(R.string.music_library);
            mActionBar.setSubtitle(R.string.touch_to_shuffle_all);
        }
        if (mAlbumArtLoader != null) {
            mAlbumArtLoader.cancel(true);
        }
        mAlbumArtLoader = new AsyncAlbumArtLoader();
        mAlbumArtLoader.execute();
    } catch (RemoteException e) {
        e.printStackTrace();
    }
}

From source file:com.morlunk.mumbleclient.channel.actionmode.UserActionModeCallback.java

@Override
public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
    try {//from  w  w  w .j  ava  2s  .c  o  m
        // Use permission data to determine the actions available.
        boolean self = mUser.getSession() == mService.getSession();
        int perms = mService.getPermissions();
        Channel channel = mService.getChannel(mUser.getChannelId());
        int channelPerms = channel.getId() != 0 ? channel.getPermissions() : perms;

        menu.findItem(R.id.context_kick)
                .setVisible(!self && (perms & (Permissions.Kick | Permissions.Ban | Permissions.Write)) > 0);
        menu.findItem(R.id.context_ban)
                .setVisible(!self && (perms & (Permissions.Ban | Permissions.Write)) > 0);
        menu.findItem(R.id.context_mute)
                .setVisible(((channelPerms & (Permissions.Write | Permissions.MuteDeafen)) > 0
                        && (!self || mUser.isMuted() || mUser.isSuppressed())));
        menu.findItem(R.id.context_deafen)
                .setVisible(((channelPerms & (Permissions.Write | Permissions.MuteDeafen)) > 0
                        && (!self || mUser.isDeafened())));
        menu.findItem(R.id.context_priority)
                .setVisible(((channelPerms & (Permissions.Write | Permissions.MuteDeafen)) > 0));
        menu.findItem(R.id.context_move).setVisible(!self && (perms & Permissions.Move) > 0);
        menu.findItem(R.id.context_change_comment).setVisible(self);
        menu.findItem(R.id.context_reset_comment).setVisible(!self && mUser.getCommentHash() != null
                && !mUser.getCommentHash().isEmpty() && (perms & (Permissions.Move | Permissions.Write)) > 0);
        menu.findItem(R.id.context_view_comment)
                .setVisible((mUser.getComment() != null && !mUser.getComment().isEmpty())
                        || (mUser.getCommentHash() != null && !mUser.getCommentHash().isEmpty()));
        menu.findItem(R.id.context_register).setVisible(
                mUser.getUserId() < 0 && (mUser.getHash() != null && !mUser.getHash().isEmpty()) && (perms
                        & ((self ? Permissions.SelfRegister : Permissions.Register) | Permissions.Write)) > 0);
        menu.findItem(R.id.context_local_mute).setVisible(!self);
        menu.findItem(R.id.context_ignore_messages).setVisible(!self);

        // TODO info
        //            informationItem.enabled = (((perms & (Permissions.Write | Permissions.Register))) > 0 || (channelPermissions & (Permissions.Write | Permissions.Enter)) > 0 || (mUser.getSession() == mService.getSession()));

        // Highlight toggles
        menu.findItem(R.id.context_mute).setChecked(mUser.isMuted() || mUser.isSuppressed());
        menu.findItem(R.id.context_deafen).setChecked(mUser.isDeafened());
        menu.findItem(R.id.context_priority).setChecked(mUser.isPrioritySpeaker());
        menu.findItem(R.id.context_local_mute).setChecked(mUser.isLocalMuted());
        menu.findItem(R.id.context_ignore_messages).setChecked(mUser.isLocalIgnored());
    } catch (RemoteException e) {
        e.printStackTrace();
        return false;
    }
    return true;
}

From source file:com.subzero.runners.android.AndroidLauncher.java

@Override
public void queryPurchases(Preferences pref) {
    this.pref = pref;
    try {/*w  w w.  ja  v  a 2  s  .  com*/
        Bundle ownedItems = mService.getPurchases(3, getPackageName(), "inapp", null);
        int response = ownedItems.getInt("RESPONSE_CODE");
        if (response == 0) {
            ArrayList<String> ownedSkus = ownedItems.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");

            for (int i = 0; i < ownedSkus.size(); i++) {
                String name = null;

                if (ownedSkus.get(i).equals("ryan"))
                    name = "Ryan";
                else if (ownedSkus.get(i).equals("ash"))
                    name = "Ash";
                else if (ownedSkus.get(i).equals("rob"))
                    name = "Rob";
                else if (ownedSkus.get(i).equals("battle_cat"))
                    name = "BattleCat";
                else if (ownedSkus.get(i).equals("xorp"))
                    name = "Xorp";
                else if (ownedSkus.get(i).equals("rootsworth"))
                    name = "Rootsworth";
                else if (ownedSkus.get(i).equals("snap"))
                    name = "Snap";
                else if (ownedSkus.get(i).equals("metatron"))
                    name = "Metatron";
                else if (ownedSkus.get(i).equals("abaddon"))
                    name = "Abaddon";

                pref.putBoolean(name, true);
                pref.flush();
            }
        }
    } catch (RemoteException e) {
        e.printStackTrace();
    }

}

From source file:org.gateshipone.odyssey.fragments.ArtistAlbumsFragment.java

/**
 * Call the PBS to play artist./*w  ww.  j  a  v a2s.  co  m*/
 * A previous playlist will be cleared.
 */
private void playArtist() {

    // play all album of current artist if exists

    // Remove old tracks
    try {
        mServiceConnection.getPBS().clearPlaylist();
    } catch (RemoteException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }

    // enqueue artist
    enqueueArtist();

    // play album
    try {
        mServiceConnection.getPBS().jumpTo(0);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:xiaofei.library.hermes.internal.Channel.java

public void gc(Class<? extends HermesService> service, List<Long> timeStamps) {
    IHermesService hermesService = mHermesServices.get(service);
    if (hermesService == null) {
        Log.e(TAG,/*from  w  w  w.jav  a 2  s  .c o  m*/
                "Service Unavailable: Check whether you have disconnected the service before a process dies.");
    } else {
        try {
            hermesService.gc(timeStamps);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
}

From source file:com.example.seonoh2.smarttoliet01.beacon.RecoMonitoringActivity.java

@Override
protected void stop(ArrayList<RECOBeaconRegion> regions) {
    for (RECOBeaconRegion region : regions) {
        try {/*from   w  w w . j  a v  a  2  s.  c  om*/
            mRecoManager.stopMonitoringForRegion(region);
        } catch (RemoteException e) {
            Log.i("RecoMonitoringActivity", "Remote Exception");
            e.printStackTrace();
        } catch (NullPointerException e) {
            Log.i("RecoMonitoringActivity", "Null Pointer Exception");
            e.printStackTrace();
        }
    }
}

From source file:com.ariesmcrae.mymemories.ui.story.EditStoryFragment.java

public void doSaveButtonClick() {
    Toast.makeText(getActivity(), "Updated.", Toast.LENGTH_SHORT).show();
    StoryData location = makeStoryDataFromUI();
    if (location != null) {
        try {/*  w w w. j a  va 2s .  c  o  m*/
            resolver.updateStoryWithID(location);
        } catch (RemoteException e) {
            e.printStackTrace();
            return;
        }
    } else {
        return;
    }
    if (getResources().getBoolean(R.bool.isTablet) == true) {
        mOpener.openViewStoryFragment(getUniqueKey());
    } else {
        getActivity().finish(); // same as hitting 'back' button
    }
}

From source file:com.example.seonoh2.smarttoliet01.beacon.RecoMonitoringActivity.java

@Override
protected void start(ArrayList<RECOBeaconRegion> regions) {
    Log.i("RecoMonitoringActivity", "start");

    for (RECOBeaconRegion region : regions) {
        try {//from   w  ww.j  a  v  a  2  s  .co  m
            region.setRegionExpirationTimeMillis(60 * 1000L);
            mRecoManager.startMonitoringForRegion(region);
        } catch (RemoteException e) {
            Log.i("RECOMonitoringActivity", "Remote Exception");
            e.printStackTrace();
        } catch (NullPointerException e) {
            Log.i("RecoMonitoringActivity", "Null Pointer Exception");
            e.printStackTrace();
        }
    }
}

From source file:org.deviceconnect.android.deviceplugin.host.setting.HostSettingFragment.java

/**
 * Host PluginInvoke???./*from   ww w  . ja va2  s  .c o m*/
 */
public void invokeHost() {

    showProgressDialog();
    try {
        mService.invokeHost();
    } catch (RemoteException e) {
        if (BuildConfig.DEBUG) {
            e.printStackTrace();
        }
    }
    dismissProgressDialog();
}

From source file:com.terracom.mumbleclient.channel.ChannelFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_channel, container, false);
    mViewPager = (ViewPager) view.findViewById(R.id.channel_view_pager);
    mTabStrip = (PagerTabStrip) view.findViewById(R.id.channel_tab_strip);
    if (mTabStrip != null) {
        int[] attrs = new int[] { R.attr.colorPrimary, android.R.attr.textColorPrimaryInverse };
        TypedArray a = getActivity().obtainStyledAttributes(attrs);
        int titleStripBackground = a.getColor(0, -1);
        int titleStripColor = a.getColor(1, -1);
        a.recycle();/*from   w w  w.j  ava2  s.com*/

        mTabStrip.setTextColor(titleStripColor);
        mTabStrip.setTabIndicatorColor(titleStripColor);
        mTabStrip.setBackgroundColor(titleStripBackground);
        mTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
    }

    mTalkView = view.findViewById(R.id.pushtotalk_view);
    mTalkButton = (Button) view.findViewById(R.id.pushtotalk);
    mTalkButton.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            try {
                boolean oldState = getService().isTalking();
                boolean newState;
                if (event.getAction() == MotionEvent.ACTION_DOWN) {
                    newState = !mTogglePTT || !oldState;
                } else if (event.getAction() == MotionEvent.ACTION_UP) {
                    newState = mTogglePTT && oldState;
                } else {
                    return true;
                }

                if (newState != oldState) {
                    getService().setTalkingState(newState);
                }
            } catch (RemoteException e) {
                e.printStackTrace();
            }
            return true;
        }
    });
    configureInput();
    return view;
}