Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (47 sloc) 1.59 KB
[Module Metadata]
AUTHOR=Sarah Edwards/mac4n6.com/@iamevltwin
MODULE_NOTES=Records which Springboard screen device is on. Homescreen(s)=2 Widgets=19, Control Center=5, Lock Screen=9, Pin Unlock Screen=15, Blank Screen=0, App Switcher=4, Spotlight Search=18, Lock Screen Camera=11, Lock Screen Widgets=17
[Database Metadata]
DATABASE=CurrentPowerlog.PLSQL
PLATFORMS=IOS
VERSIONS=9,10,11,12
[Query Metadata]
QUERY_NAME=powerlog_device_screen
ACTIVITY=Device State
KEY_TIMESTAMP=ADJUSTED_TIMESTAMP
[SQL Query 9,10,11,12]
QUERY=
SELECT
DATETIME(SCREENSTATE_TIMESTAMP + SYSTEM, 'unixepoch') AS ADJUSTED_TIMESTAMP,
SCREEN,
DATETIME(SCREENSTATE_TIMESTAMP, 'unixepoch') AS ORIGINAL_SCREENSTATE_TIMESTAMP,
DATETIME(TIME_OFFSET_TIMESTAMP, 'unixepoch') AS OFFSET_TIMESTAMP,
SYSTEM AS TIME_OFFSET,
SCREENSTATE_ID AS "PLSPRINGBOARDAGENT_EVENTFORWARD_SBSCREEN TABLE ID"
FROM
(
SELECT
SCREENSTATE_ID,
SCREENSTATE_TIMESTAMP,
TIME_OFFSET_TIMESTAMP,
MAX(TIME_OFFSET_ID) AS MAX_ID,
SCREEN,
SYSTEM
FROM
(
SELECT
PLSPRINGBOARDAGENT_EVENTFORWARD_SBSCREEN.TIMESTAMP AS SCREENSTATE_TIMESTAMP,
SCREEN,
PLSPRINGBOARDAGENT_EVENTFORWARD_SBSCREEN.ID AS "SCREENSTATE_ID" ,
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET.TIMESTAMP AS TIME_OFFSET_TIMESTAMP,
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET.ID AS TIME_OFFSET_ID,
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET.SYSTEM
FROM
PLSPRINGBOARDAGENT_EVENTFORWARD_SBSCREEN
LEFT JOIN
PLSTORAGEOPERATOR_EVENTFORWARD_TIMEOFFSET
)
AS SCREENSTATE_STATE
GROUP BY
SCREENSTATE_ID
)