Java Code Examples for android.os.Message#getCallback()

The following examples show how to use android.os.Message#getCallback() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PluginHelper.java    From letv with Apache License 2.0 6 votes vote down vote up
private void findLbeMessageAndRemoveIt(Message message) {
    if (message != null) {
        Runnable callback = message.getCallback();
        if (message.what == 0 && callback != null && callback.getClass().getName().indexOf("com.lbe.security.client") >= 0) {
            message.getTarget().removeCallbacks(callback);
        }
        try {
            Object nextObj = FieldUtils.readField((Object) message, "next", true);
            if (nextObj != null) {
                findLbeMessageAndRemoveIt((Message) nextObj);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
Example 2
Source File: PluginHelper.java    From DroidPlugin with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void findLbeMessageAndRemoveIt(Message message) {
    if (message == null) {
        return;
    }
    Runnable callback = message.getCallback();
    if (message.what == 0 && callback != null) {
        if (callback.getClass().getName().indexOf("com.lbe.security.client") >= 0) {
            message.getTarget().removeCallbacks(callback);
        }
    }

    try {
        Object nextObj = FieldUtils.readField(message, "next", true);
        if (nextObj != null) {
            Message next = (Message) nextObj;
            findLbeMessageAndRemoveIt(next);
        }
    } catch (Exception e) {
        Log.e(TAG, "findLbeMessageAndRemoveIt:error on remove lbe message", e);
    }

}
 
Example 3
Source File: OpenVPNService.java    From Cake-VPN with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean handleMessage(Message msg) {
    Runnable r = msg.getCallback();
    if (r != null) {
        r.run();
        return true;
    } else {
        return false;
    }
}
 
Example 4
Source File: OpenVPNService.java    From SimpleOpenVpn-Android with Apache License 2.0 5 votes vote down vote up
@Override
public boolean handleMessage(Message msg) {
    Runnable r = msg.getCallback();
    if (r != null) {
        r.run();
        return true;
    } else {
        return false;
    }
}
 
Example 5
Source File: TileView.java    From VideoTrimmer_Android with MIT License 5 votes vote down vote up
@Override
public void handleMessage(Message msg) {
    Runnable callback = msg.getCallback();
    if (callback != null) {
        callback.run();
        decrementToken((Token) msg.obj);
    } else {
        super.handleMessage(msg);
    }
}
 
Example 6
Source File: OpenVPNService.java    From Cybernet-VPN with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean handleMessage(Message msg) {
    Runnable r = msg.getCallback();
    if (r != null) {
        r.run();
        return true;
    } else {
        return false;
    }
}
 
Example 7
Source File: OpenVPNService.java    From EasyVPN-Free with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean handleMessage(Message msg) {
    Runnable r = msg.getCallback();
    if (r != null) {
        r.run();
        return true;
    } else {
        return false;
    }
}
 
Example 8
Source File: OpenVPNService.java    From android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean handleMessage(Message msg) {
    Runnable r = msg.getCallback();
    if (r != null) {
        r.run();
        return true;
    } else {
        return false;
    }
}
 
Example 9
Source File: OpenVPNService.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean handleMessage(Message msg) {
    Runnable r = msg.getCallback();
    if (r != null) {
        r.run();
        return true;
    } else {
        return false;
    }
}