This reverts commit 20fb2c25 but fixes the logic and adds a unit test. Bug: 12077632 Test: Ran BlockGuardOsTest Change-Id: Ic90f9356101c3821c417b240c146ddff2ba54289