I believe the answer can only be empirical, not definitive.
To examine some of the figures mentioned:
there is a 20% inefficiency (which I do not know if it is true for most portable charger)
A portable charger that is itself charged from USB (5 Volts) would need a boost converter to be able to supply 5 volts at its output. Boost converters commonly mention efficiency of 65 to 85%. TI's TPS61030, TPS61031 and TPS61032 state 96%, and Maxim's MAX8815A states 97% efficiency.
These figures do not account for possible efficiency loss due to external components (ESR of capacitors for instance) or temperature variation. Thus, treat that "20%" number as indicative at best.
your phone needs power for stand-by, so in my experience, you'll have just 65% capacity.
That would depend on whether the phone is kept powered on while charging, what power intensive tasks (e.g. WiFi, social media polling software) are running on the phone, and even the current draw of the phone in the nominal "powered off" state - Some smartphones do not actually power off completely unless the battery is pulled out.
Thus, that 65% number is also indicative at best, though varying it somewhat is within the user's control.
by industrial standards for batteries is +/- 20% tolerance admitted with capacity.
That number would be defined in the datasheet of the specific battery in question. It would also vary widely by age / charge cycle history of the battery, temperature, contact oxidation and possibly several other factors.
So, while the number is a reasonable guesstimate, it is not definitive.
Note that this last figure is applicable to both, the cellphone battery and the portable charger battery.
So, can one use the magical value 45% as a gauge for portable battery charger?
Clearly not. The only numbers that can be used, even as a rule of thumb, are those empirically measured for your particular situation and use pattern. Even so, the percentage will change widely over charge cycles, season and time of day (temperature factors).
You don't mention what case style of 7805 you have. If i was guessing you are using a TO220. That case can only support up to 1A output current and even then requires substantial heat sinking to do so. Some 7805s had thermal protection and would shut down if overheating. Check the voltage to the device when it shuts down. Perhaps the voltage drops out.
Also you cryptically say that it's a 5v device. If i also had to guess it's a USB device. Some USB devices require that an identified is detected on the data lines to announce that the device is connected to a charger. For example my HTC phone charger shorts the data lines together. Also my Galaxy tab doesn't like my HTC charger because Samsung uses a different scheme to identify the charger.
Best Answer
You probably can't do anything reasonable. Charging power banks are designed to cut off power when they think the charge is done, when load drops below certain cut-off level. This condition will happen every time you connect-disconnect your project while debugging it.
you can load it with proper resistor, but it will drain the bank battery quickly.
you can reverse engineer your powerbank, determine what kind of PMIC (power management IC) is used, and disable this cut-off function if possible, but it is very doubtful.
You need to design your own PMIC on the top of existing circuit, replace it with power management you need. This new design must have all features to charge and protect the powerbank battery, but will have no cut-off function.