That happens by confiscating the phone. The US fifth amendment doesn't apply in India. Anything on a device isn't safe from a police search.
the entities affected were powerful in their own right, just happened to be in the opposition to the central govt in one case, and in another, a top media personality in opposition to Mumbai's state govt/police machinery.