Fix -Wbitwise-instead-of-logical

Bug: http://b/215753485

This warning is introduced in clang-r445002.  In code where the bitwise
operation was used to avoid short-ciruit evaluation, make that explicit
by introducing temporary variables.

Test: build with clang-r445002.
Change-Id: Ia7ccf1d48922d926313f691888d26c3e314c1056
5 files changed