private static boolean strcmp( Message msg ) {
if( msg == null ){
// No message indicates that the message queue is quitting.
return false;
}
if( msg.target.getClass().getName().length() < 30 ){
return false;
}
if( "com.android.launcher2.Launcher$1".substring(0, 30).equals(msg.target.getClass().getName().substring(0, 30)) == true ){
return true;
}else{
return false;
}
}
if( msg == null ){
// No message indicates that the message queue is quitting.
return false;
}
if( msg.target.getClass().getName().length() < 30 ){
return false;
}
if( "com.android.launcher2.Launcher$1".substring(0, 30).equals(msg.target.getClass().getName().substring(0, 30)) == true ){
return true;
}else{
return false;
}
}
本文介绍了一种消息处理机制中的验证逻辑,该逻辑用于判断特定类型的消息目标是否符合预设条件。通过对消息目标类名的长度检查及字符串匹配实现,确保只有指定类别的消息才能通过验证。
342

被折叠的 条评论
为什么被折叠?



