ProfileManager: fix coding style

Change-Id: Ia0c3dac6b73e2f22bae818f7ab992a9cfcadfa57
Fix getPrivacyGuardSettingForPackage()

Return true only if op mode is not allowed
and is not denied by a user restriction.

Change-Id: I8e58266ea8ed26726a634be523aeeba84adda30f
appops: Fix an off-by-one error that causes the location icon to stay on

Commit bdfde4fc820fad768dbc596b17507e4cdc84b850 added Bluetooth AppOps
capabilities, but it contained a subtle bug where the string representation
was added in the wrong place, offseting every operation after it by 1. This
broke the toString functionality but didn't have any consequence since this
was used for logging purposes only.

Commit b01b08928a42a626f5f1c6c18a20d786fb873d75 changed AppOps so that
operations are persisted by name instead of by index, this caused the string
representation offset to affect functionality and, among other things, one
of the consequences was that coarse location requests were being interpreted
by AppOps as high-energy location requests.

Change-Id: I319f1ac1c5910098689b4cb8645eb92c0e3538cb