Restrict the permission for accessing vpn profile

These vpn profile accessing methods are designed for priviledge
or the owner apps, and they should not be accessible for any
app without correct permission. As these methods are not yet
fully depolyed, restrict these methods with NETWORK_STACK or
PERMISSION_MAINLINE_NETWORK_STACK permission to prevent them
from being accessed from the unexpected apps.

Bug: 341046194
Bug: 341253275
Flag: EXEMPT bugfix
Test: atest VpnManagerServiceTest
Test: Enable vpn from a vpn app and accessing API without
      corresponding permission from other apps. Verify
      result by accessing these hidden methods.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f1122ac36a2c9ffcb3ace49fc383870f87456c26)
Merged-In: If6fd058f40da88a4801b59187631e0c68b236ff5
Change-Id: If6fd058f40da88a4801b59187631e0c68b236ff5
1 file changed