framework: improve code

Change-Id: I7692ef5d5aa004af297f7c8616db2abe55b7f891
Pie:powerbutton 1/2

Change-Id: I3f391c0f5fd4e60bb4c9c875b9ecaa70672c2aac