Buggy code:
if ( ( ( ( entry . getKey ( ) . contains ( "path" ) ) || ( entry . getKey ( ) . contains ( "resource" ) ) ) || ( entry . getKey ( ) . contains ( "packagename" ) ) ) || ( entry . getKey ( ) . contains ( "appname" ) ) ) { comparisonString = ( ( ( "{\"" + ( entry . getKey ( ) ) ) + "\":\"" ) + ( entry . getValue ( ) ) ) + "\"}" ; } else { comparisonString = ( ( ( "{\"" + ( entry . getKey ( ) ) ) + "\":" ) + ( entry . getValue ( ) ) ) + "}" ; } Log . d ( DecisionMaker . TAG , ( "<seq2seq4repair_space>" + comparisonString ) ) ; DebugFileLog . write ( ( "DecisionMaker-<seq2seq4repair_space>" + comparisonString ) ) ; if ( resource . getCondition ( ) . contains ( "\\//" ) ) { resourceCondition = resource . getCondition ( ) . replace ( "\\//" , "//" ) ; } else { resourceCondition = resource . getCondition ( ) ; } if ( resourceCondition != null ) { Log . d ( DecisionMaker . TAG , ( ( ( ( "<seq2seq4repair_space>1:" + ( resourceCondition . toLowerCase ( ) ) ) + "--<seq2seq4repair_space>2:" ) + ( comparisonString . toLowerCase ( ) ) ) + "--" ) ) ; DebugFileLog . write ( ( ( ( ( "DecisionMaker-<seq2seq4repair_space>1:" + ( resourceCondition . toLowerCase ( ) ) ) + "--<seq2seq4repair_space>2:" ) + ( comparisonString . toLowerCase ( ) ) ) + "--" ) ) ; } if ( resourceCondition . toLowerCase ( ) . equals ( comparisonString . toLowerCase ( ) ) ) { Log . d ( DecisionMaker . TAG , "<seq2seq4repair_space>Match!" ) ; DebugFileLog . write ( "DecisionMaker-<seq2seq4repair_space>Match!" ) ; resourceInPolicy = resource ; matchedCondition = resource . getCondition ( ) ; match = true ; break ; } else { Log . d ( DecisionMaker . TAG , ( "<seq2seq4repair_space>No<seq2seq4repair_space>Match!" + comparisonString ) ) ; DebugFileLog . write ( ( "DecisionMaker-<seq2seq4repair_space>No<seq2seq4repair_space>Match!" + comparisonString ) ) ; try { if ( resourceCondition . contains ( ":" ) ) { String property = resourceCondition . substring ( 0 , ( ( resourceCondition . indexOf ( ":" ) ) - 1 ) ) ; Log . d ( DecisionMaker . TAG , ( "property:" + property ) ) ; DebugFileLog . write ( ( "DecisionMaker-property:" + property ) ) ; if ( property . contains ( entry . getKey ( ) ) ) { int intValue = - 1 ; String value = resource . getCondition ( ) . substring ( ( ( resourceCondition . indexOf ( ":" ) ) + 1 ) , ( ( resourceCondition . length ( ) ) - 1 ) ) ; Log . d ( DecisionMaker . TAG , ( "value:" + value ) ) ; DebugFileLog . write ( ( "DecisionMaker-value:" + value ) ) ; try { intValue = Integer . valueOf ( value ) ; } catch ( NumberFormatException e ) { Log . d ( DecisionMaker . TAG , ( ( "value<seq2seq4repair_space>" + value ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>number" ) ) ; DebugFileLog . write ( ( ( "DecisionMaker-value<seq2seq4repair_space>" + value ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>number" ) ) ; } if ( intValue != ( - 1 ) ) { int currentValue = - 1 ; Log . d ( DecisionMaker . TAG , ( "Current<seq2seq4repair_space>value:" + ( entry . getValue ( ) ) ) ) ; DebugFileLog . write ( ( "DecisionMaker-Current<seq2seq4repair_space>value:" + ( entry . getValue ( ) ) ) ) ; try { currentValue = Integer . valueOf ( entry . getValue ( ) ) ; } catch ( NumberFormatException e ) { Log . d ( DecisionMaker . TAG , ( ( "current<seq2seq4repair_space>value<seq2seq4repair_space>" + ( entry . getValue ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>number" ) ) ; DebugFileLog . write ( ( ( "DecisionMaker-current<seq2seq4repair_space>value<seq2seq4repair_space>" + ( entry . getValue ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>number" ) ) ; } if ( currentValue != ( - 1 ) ) { if ( currentValue < intValue ) { Log . d ( DecisionMaker . TAG , ( ( ( "Current<seq2seq4repair_space>value<seq2seq4repair_space>" + currentValue ) + "<seq2seq4repair_space>is<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>" ) + intValue ) ) ; DebugFileLog . write ( ( ( ( "DecisionMaker-Current<seq2seq4repair_space>value<seq2seq4repair_space>" + currentValue ) + "<seq2seq4repair_space>is<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>" ) + intValue ) ) ; Log . d ( DecisionMaker . TAG , "Allow" ) ; DebugFileLog . write ( "DecisionMaker-Allow" ) ; dbManager . closeDB ( ) ; return getConditionNotSatisfiedDecision ( ) ; } else { Log . d ( DecisionMaker . TAG , ( ( ( "Current<seq2seq4repair_space>value<seq2seq4repair_space>" + currentValue ) + "<seq2seq4repair_space>is<seq2seq4repair_space>greater<seq2seq4repair_space>or<seq2seq4repair_space>equal<seq2seq4repair_space>than<seq2seq4repair_space>" ) + intValue ) ) ; DebugFileLog . write ( ( ( ( "DecisionMaker-Current<seq2seq4repair_space>value<seq2seq4repair_space>" + currentValue ) + "<seq2seq4repair_space>is<seq2seq4repair_space>greater<seq2seq4repair_space>or<seq2seq4repair_space>equal<seq2seq4repair_space>than<seq2seq4repair_space>" ) + intValue ) ) ; } } } } } } catch ( Exception e ) { Log . d ( DecisionMaker . TAG , e . getMessage ( ) ) ; } } <START_BUG> if ( resourceCondition . contains ( "wifi" ) ) { <END_BUG>

Fix:
if ( ( resourceCondition . contains ( "wifi" ) ) || ( resourceCondition . contains ( "bluetooth" ) ) ) {