When a battery in a device is charged with an USB charger, who decides at what amperage?
Good quality charging implementation: both. The power source states it’s max current, the charging device uses whatever it wants as long as it stays within in the limits communicated by the power source.
Medium/bad quality (most flashlights): the device only. If the power source can’t handle the current the device wants, it will just be pushed into over current shutdown.
Most complex design (mainly phones): the device tells the charger the voltage/current, and the charger does CC/CV based on the communication from the device. USB-C PD PPS does this, and some versions of Qualcomm QC and other weirdo proprietary phone charging protocols. I have not seen this in a flashlight yet.
In any case the charging controller inside the flashlight limits the charging current und stops charging when the battery is full.