Merge "Make onPackage[Added|Removed] as non-public methods"
This commit is contained in:
@@ -758,7 +758,8 @@ public class PermissionMonitor {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public synchronized void onPackageAdded(@NonNull final String packageName, final int uid) {
|
@VisibleForTesting
|
||||||
|
synchronized void onPackageAdded(@NonNull final String packageName, final int uid) {
|
||||||
// Update uid permission.
|
// Update uid permission.
|
||||||
updateAppIdTrafficPermission(uid);
|
updateAppIdTrafficPermission(uid);
|
||||||
// Get the appId permission from all users then send the latest permission to netd.
|
// Get the appId permission from all users then send the latest permission to netd.
|
||||||
@@ -821,7 +822,8 @@ public class PermissionMonitor {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public synchronized void onPackageRemoved(@NonNull final String packageName, final int uid) {
|
@VisibleForTesting
|
||||||
|
synchronized void onPackageRemoved(@NonNull final String packageName, final int uid) {
|
||||||
// Update uid permission.
|
// Update uid permission.
|
||||||
updateAppIdTrafficPermission(uid);
|
updateAppIdTrafficPermission(uid);
|
||||||
// Get the appId permission from all users then send the latest permission to netd.
|
// Get the appId permission from all users then send the latest permission to netd.
|
||||||
|
|||||||
@@ -3477,7 +3477,12 @@ public class ConnectivityServiceTest {
|
|||||||
final int uid, final String packageName) throws Exception {
|
final int uid, final String packageName) throws Exception {
|
||||||
doReturn(buildPackageInfo(true /* hasSystemPermission */, uid)).when(mPackageManager)
|
doReturn(buildPackageInfo(true /* hasSystemPermission */, uid)).when(mPackageManager)
|
||||||
.getPackageInfo(eq(packageName), eq(GET_PERMISSIONS));
|
.getPackageInfo(eq(packageName), eq(GET_PERMISSIONS));
|
||||||
mService.mPermissionMonitor.onPackageAdded(packageName, uid);
|
|
||||||
|
// Send a broadcast indicating a package was installed.
|
||||||
|
final Intent addedIntent = new Intent(ACTION_PACKAGE_ADDED);
|
||||||
|
addedIntent.putExtra(Intent.EXTRA_UID, uid);
|
||||||
|
addedIntent.setData(Uri.parse("package:" + packageName));
|
||||||
|
processBroadcast(addedIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user