You can do this with Macrodroid.
Macrodroid is an app that automates various tasks in your phone. It lets you create custom "macros" that trigger actions or sequences of actions in response to specific events.
Follow these steps:
0: Install and open the app ๐
1: Press Add Macro
2: Give it a name
3: Triggers > Battery/Power > Power Connected/Disconnected > Power Disconnected > OK
4: Actions > Screen > Screen On/Off > Screen Off > OK > Lock Screen > OK
5: Save
That's about it!
You do need to give it device admin permission and make sure your os doesn't kill the app to "save battery".
Obviously I am wayyy too late but here's what I found.
Sale of new mobile phones has dropped significantly in the last few quarters because of global price inflation of consumer goods. Naturally, mobile chip sales has also dropped.
Since making a chip takes ~6 months, Qualcomm currently has too many old chips in their inventory because even if they completely stop making new chips, they'll still produce chips for the next 6 months.
Because of that existing inventory, they aren't selling new chips to OEMs until their old stock is depleted. Which (I'm speculating) has led to OEMs buying chips from MediaTek instead. Which has farther delayed the production of new chips.
Partial sources
Nov 2022
Feb 2023
May 2023
Aug 2023