Merge "Add a test for `shouldDeviceBePutToSleep` when performing the first state transition" into tm-qpr-dev