Home » Android » BindService() call fails on Android Marshmallow Device (just one user)

BindService() call fails on Android Marshmallow Device (just one user)

Posted by: admin November 1, 2017 Leave a comment

Questions:

I have an app on the google play store with ~7000 users, its a graphing plugin app for a popular automotive monitoring app called “Torque Pro”. I have one user on a Pendo Pad tablet w/ Android 6.0.1 (Marshmallow) where the bindservice() call to a remote service returns false. I have many other users on all version that are running w/o any issue, just one user stuck with this problem.

My app binds to a remote service (torque plugin service) in another process. Code is below, works fine as I said for all other users and on my test devices (Android V2.3.1, V4.4, V5.1).

I am assuming that this an app permission issue or security issue w/ Marshmallow. Hoping someone knows the setting to fix this.

Thanks for the help,

Phil

public void doBindService() {

    try {

        // Bind to the torque service
        Intent intent = new Intent();

        String pkg = "org.prowl.torque";
        String cls = "org.prowl.torque.remote.TorqueService";

        intent.setPackage(pkg);
        intent.setComponent(new ComponentName(pkg, cls));
        intent.setClassName(pkg, cls);

        if (!mIsBound) {
            boolean status = bindService(intent, connection, Context.BIND_AUTO_CREATE);

            if (status == false) {
                toast("RTC Error - Bind failed to Torque Pro Service", PluginActivity.this);
            } else {
                mIsBound = true;
            }
        }
    } catch (Exception e) {
        popupMessage("RTC Bind Service Exception", "Exception while binding to Torque Pro Service.",
                false, handler, PluginActivity.this);

    }
}
Answers: