There is an oil filter for the VVVT solenoid, the size of a AAA battery, at front top of the engine, passenger side, going into the valve head. It may be dirty and blocks oil therefore VVVT works intermittently
Instead of removing the filter, it's easier to Try Motor Medic GUNK engine cleaner (WALMART $6). Add half quart into engine oil and idle 10 minutes. It should dissolve oil sludge in many places and free up mechanisms. If the old oil is very black, you may need to do it more than once.
P1349 Code - General
Variable Valve Timing System Malfunction - Bank 1
OBD-II code P1349 indicates a problem with the variable valve timing system in your Toyota.
Your Toyota's variable valve timing, or VVT, system is responsible for controlling and adjusting the intake valve timing according to driving conditions. The engine control module, or ECM, controls the oil control valve, or OCV, to make the intake valve timing accurate, and so that oil pressure controlled by the OCV is properly supplied to the VVT controller. From there, the VVT controller changes position between the cam and crankshaft. The code, P1349 is triggered when the valve timing isn't changing from the current valve timing state, or when the valve timing is fixed.
Possible causes of trouble code P1349 include:
Low or dirty engine oil
Incorrect valve timing
Faulty oil control valve
Faulty variable valve timing controlled assembly
Faulty engine control module (ECM)
Getting to the bottom of this problem can be tricky since possible causes vary so greatly. Checking the oil to determine if it is low or dirty can eliminate the easiest of the possible problems. From there, you will need to check the timing to see how off everything is. Considering the problem to be a faulty engine control module should be the very last on your list. If you have addressed every other issue and the light is still illuminated, try clearing the code to see if it returns -- if it does, it might be a sign of a bad ECM. Other signs of ECM problems include poor performance, failure to start, and erratic gear changes on automatic transmission.