- Open Tasker and click "New" and name the profile "Charging"
- Choose "State" and select "Power" for this example we'll make it work on both USB charging and AC power so in the dropdown box select "Any"
- Select "New Task" and name it "Screen on" Click the "Add" button in the bottom left - choose "Display" and then "Display Timeout" go ahead and choose how long you want the screen to remain on for. I have mine set to 5 minutes. Click "Done" and then click "Done" again
Next we have to make an Exit Task, this is what tells the phone what to do when the charging cable is unplugged. You should have your two tasks showing - "Power" and "Screen On". Click on the Green arrow next to the "Screen on" task. You should now have the option to "Add Exit Task"
- Click "Add Exit Task" and choose "New Task" name it "Screen Off"
- Click the Add button in the bottom left and choose "Display" and "Display Timeout"
- Choose how long you want your screen to remain on when not charging - I have mine set to 30 seconds.
- Click "Done"
- Click "Done" again.
Now you should be able to plug in your USB cable and the phone will keep the screen on for the specified 5 minutes before locking the device.