Adds back hasFlag check for DeviceState toString method

Cts uses the output from DeviceState toString to determine
if certain states should not be used

Bug: 330658669
Test: Manual toString check
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7303ab84104cce1136886c61137b1af90c29cb97)
Merged-In: I94cd8ea4f53e42190789b1460987fc7bc855e01f
Merged-In: Iadeb933fb5e5be1ef255fb2ca9fcc69c12147d7d
Change-Id: I94cd8ea4f53e42190789b1460987fc7bc855e01f
24D1-dev is based on 24Q2-release. Therefore, we merged this CL to 24D1-dev.
1 file changed