You can use adb for this. Run this command:
adb shell dumpsys activity broadcasts
The output would be overwhelming, but you need to look for the string android.intent.action.AIRPLANE_MODE there. You can use grep or save the output into a file and then do the search.
Look for that string under Historical Broadcast Background. You would find the timestamp you're looking for. It could look like this:
Historical Broadcast background #345:
BroadcastRecord{
48eb128 u-1 android.intent.action.AIRPLANE_MODE
}
to user -1
Intent {
act=android.intent.action.AIRPLANE_MODE flg=0x10 (has extras)
}
extras: Bundle[{
state=true
}
]
caller=android 1298:system/1000 pid=1298 uid=1000
enqueueClockTime=2019-01-10 00:00:01 dispatchClockTime=2019-01-10 00:00:01
You can also look under Historical Broadcasts summary (background).
#15: act=android.intent.action.AIRPLANE_MODE flg=0x10 (has extras)
0 dispatch +1ms finish
enq=2019-01-10 00:19:14 disp=2019-01-10 00:19:14 fin=2019-01-10 00:19:14
extras: Bundle[{
state=false
}
]
state=true
means Airplane mode was activated. state=false
means it was deactivated.
All of this may seem like a trouble, so I suggest you use an automation app to listen to the intent for Airplane mode and take an action for you for convenience.
Both Tasker and MacroDroid should be able to help with this. In MacroDroid,
Trigger: Intent Received First:
- Action: android.intent.action.AIRPLANE_MODE
- Intent Extra:
- Extra name: state
- Extra value to match: true
Actions: do what you want with that
Constraints: none
Save this. Now clone this, configure the trigger and change the value for state to false. So you would have triggers for both states of Airplane mode.