Rules at the border tend to be pretty restrictive almost everywhere. You can literally get in trouble for having a sandwich in your bag. I'd wager Hong Kong border control was also empowered to request phone passwords and turn away refusers long before this change.