Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 280665f0 authored by Jaime Lopez's avatar Jaime Lopez Committed by Linux Build Service Account
Browse files

Telephony: Add NET_RAW,NET_ADMIN,QCOM_DIAG, CAMERA capability

NET_RAW, NET_ADMIN, QCOM_DIAG, CAMERA capability is added
to radio user in PackageManager
This change is needed to allow IMS DPL Thin client
(media handling library for IMS/VT) access
to qmi ports it needs to talk to the DPL on the modem side.

Change-Id: Ic43c773224d5cf3fb726902b0447212d0da97929
CRs-Fixed: 365959
(cherry picked from commit ff7f8aa8113e9fb7d4fdcd71ba5dfa16e734d0c6)
(cherry picked from commit d20e5e553ede06e368faa7ce04a131196973bc55)
(cherry picked from commit 89163128e80117ac32db1da115f05be263d5a394)
parent ac333fa3
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -99,6 +100,20 @@ public class Process {
     */
    public static final int DRM_UID = 1019;

    /**
     * Defines the UID/GID for the AID_NET RAW process.
     * AID_NET_RAW can create raw INET sockets
     * @hide
     */
    public static final int UID_NET_RAW = 3004;

    /**
     * Defines the UID/GID for the AID_NET_ADMIN process.
     * can configure interfaces and routing tables
     * @hide
     */
    public static final int UID_NET_ADMIN = 3005;

    /**
     * Defines the UID/GID for the group that controls VPN services.
     * @hide
+8 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -196,6 +197,11 @@ public class PackageManagerService extends IPackageManager.Stub {
    private static final int BLUETOOTH_UID = Process.BLUETOOTH_UID;
    private static final int SHELL_UID = Process.SHELL_UID;

    private static final int UID_NET_RAW = Process.UID_NET_RAW;
    private static final int UID_NET_ADMIN = Process.UID_NET_ADMIN;
    private static final int UID_QCOM_DIAG = 3009;
    private static final int UID_QCOM_CAMERA = 1006;

    private static final boolean GET_CERTIFICATES = true;

    private static final int REMOVE_EVENTS =
@@ -1077,7 +1083,8 @@ public class PackageManagerService extends IPackageManager.Stub {
        mSettings.addSharedUserLPw("android.uid.system", Process.SYSTEM_UID,
                ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PRIVILEGED);
        mSettings.addSharedUserLPw("android.uid.phone", RADIO_UID,
                ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PRIVILEGED);
                ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PRIVILEGED,
                new int[] {UID_NET_RAW, UID_QCOM_DIAG, UID_NET_ADMIN, UID_QCOM_CAMERA});
        mSettings.addSharedUserLPw("android.uid.log", LOG_UID,
                ApplicationInfo.FLAG_SYSTEM|ApplicationInfo.FLAG_PRIVILEGED);
        mSettings.addSharedUserLPw("android.uid.nfc", NFC_UID,
+10 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -333,6 +334,12 @@ final class Settings {
    }

    SharedUserSetting addSharedUserLPw(String name, int uid, int pkgFlags) {
        return addSharedUserLPw(name, uid, pkgFlags, null);
    }

    // This version of addSharedUserLPw adds the ability to set additional group ids
    // that should be granted to this shared user
    SharedUserSetting addSharedUserLPw(String name, int uid, int pkgFlags, int []gids) {
        SharedUserSetting s = mSharedUsers.get(name);
        if (s != null) {
            if (s.userId == uid) {
@@ -344,6 +351,9 @@ final class Settings {
        }
        s = new SharedUserSetting(name, pkgFlags);
        s.userId = uid;
        if (gids != null) {
            s.gids = gids.clone();
        }
        if (addUserIdLPw(uid, s, name)) {
            mSharedUsers.put(name, s);
            return s;