In Indonesia (I think even in Asia), if we have food and want to eat it in front of friends that don’t have food, then we have to offer our food to them. Eating alone in front of your friends or people that you know is considered as impolite. So if you don’t want to share food, then don’t eat in front of your friends. Of course your friends will most likely reject your offer if they know you only have small portion; but still, you have to offer.
But not in here. If you are talking with your friend and then your friend takes out his or her sandwich and start eating without offering you, that’s okay. Although you may end up with drooling, but if your friend doesn’t offer any, then he doesn’t do anything wrong from etiquette point of view.