The Indonesian government takes the smuggling, using and selling of drugs very seriously and the drug laws are unambiguous. If caught with drugs, you may have to wait for up to six months in jail before trial. As seen in high-profile cases involving foreigners, multiyear prison terms are common for people caught with illegal drugs, including marijuana. Those found guilty of dealing can be subject to the death penalty.
Gambling is illegal (although it's common, especially at cockfights), as is pornography.
Generally, you are unlikely to have any encounters with the police unless you are driving a rented car or motorcycle.
In Bali, there are police stations in all district capitals. If you have to report a crime or have other business at a police station, expect a lengthy and bureaucratic encounter. You should dress respectably, bring someone to help with translation, arrive early and be polite. You can also call the Bali Tourist Police for advice.
Some police officers may expect to receive bribes, either to overlook some crime, misdemeanour or traffic infringement (whether actual or not), or to provide a service that they should provide anyway. Generally, it's easiest to pay up – and the sooner this happens, the less it will cost. Travellers may be told there's a 'fine' to pay on the spot, while others may offer to pay a 'fine' to clear things up. How much? Generally, 50,000Rp can work wonders and the officers are not proud. If things seem unreasonable, however, ask for the officer's name and write it down.
Strong laws exist in Indonesia to prosecute people seeking to sexually exploit local children, and many countries also have extraterritorial legislation that allows nationals to be prosecuted in their own country for these crimes.
Travellers can help stop child-sex tourism by reporting suspicious behaviour. Reports can be made to the Anti Human Trafficking Unit of the Indonesian police. If you know the nationality of the individual, you can contact their embassy directly.