[US-CA] Can my landlord do this?

I live in Los Angeles and I'm renting an apartment. I smoke cigarettes. I don't smoke inside. When I first moved in, I would go outside of my building. My next door neighbor (I live in a middle unit on the first floor) had an issue with it so I would go out to the sidewalk, the public sidewalk. I've been doing that for 2 months now. I get a text from my landlord that my neighbor is complaining. I don't smoke in the walkway of the gate to get in and out of the building. But my landlord told me to either go into the street or down the block.

Edit- my landlord said if they keep getting complaints, I'll be evicted