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
Change-Id: I94cd8ea4f53e42190789b1460987fc7bc855e01f
1 file changed