Is it possible to extract the decryption key from a locked android device Is it possible to extract the decryption key from a FDE android device while the screen is locked but the phone is powered on.

Is the data only safe when the phone is off ?
Is the data only safe when the phone is off?


This is really hard to properly assess and depends on your definition of "safe" alot. However I'll assume that you mean "is the data protected by the FDE encryption?".

The clear (and obvious) answer to this is no.
You can unlock your phone quickly (without having to wait one or two seconds) so the key for the FDE must be stored in RAM and thus the security level is "lower" than when the device is turned off.

To verify this yourself, observe that you enter your password in the pre-boot authentication and have to wait a moment until your phone can tell you whether the password was correct or not. This is due to the password-based key derivation function being used there which takes a lot of computation power which can be spend right after startup bu not each time the screen is unlocked (where the user wants to access his phone quickly and doesn't want to waste CPU / battery)