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

Commit f9b27bad authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge remote-tracking branch 'origin/lineage-19.1' into v1-s

parents fd8c24a0 7d859aa9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -79,6 +79,6 @@ interface INetworkPolicyManager {
    boolean isUidNetworkingBlocked(int uid, boolean meteredNetwork);
    boolean isUidRestrictedOnMeteredNetworks(int uid);

    byte[] getBackupPayload();
    void applyRestore(in byte[] payload);
    byte[] getBackupPayload(int user);
    void applyRestore(in byte[] payload, int user);
}
+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,10 @@ public class NetworkPolicyManager {
     * @hide
     */
    public static final int POLICY_REJECT_ALL = 0x40000;
    /** Reject network usage on all networks, migration helper
     * @hide
     */
    public static final int POLICY_REJECT_ALL_MIGRATED = 0x80000;

    /*
     * Rules defining whether an uid has access to a network given its type (metered / non-metered).
+8 −5
Original line number Diff line number Diff line
@@ -33,8 +33,11 @@ public class NetworkPolicyBackupHelper extends BlobBackupHelper {
    // Key under which the payload blob is stored
    static final String KEY_NETWORK_POLICY = "network_policy";

    public NetworkPolicyBackupHelper() {
    private final int mUserId;

    public NetworkPolicyBackupHelper(int userId) {
        super(BLOB_VERSION, KEY_NETWORK_POLICY);
        mUserId = userId;
    }

    @Override
@@ -44,10 +47,10 @@ public class NetworkPolicyBackupHelper extends BlobBackupHelper {
            try {
                INetworkPolicyManager npm = INetworkPolicyManager.Stub.asInterface(
                        ServiceManager.getService(Context.NETWORK_POLICY_SERVICE));
                newPayload = npm.getBackupPayload();
                newPayload = npm.getBackupPayload(mUserId);
            } catch (Exception e) {
                // Treat as no data
                Slog.e(TAG, "Couldn't communicate with network policy manager");
                Slog.e(TAG, "Couldn't communicate with network policy manager", e);
                newPayload = null;
            }
        }
@@ -64,9 +67,9 @@ public class NetworkPolicyBackupHelper extends BlobBackupHelper {
            try {
                INetworkPolicyManager.Stub.asInterface(
                        ServiceManager.getService(Context.NETWORK_POLICY_SERVICE))
                        .applyRestore(payload);
                        .applyRestore(payload, mUserId);
            } catch (Exception e) {
                Slog.e(TAG, "Couldn't communicate with network policy manager");
                Slog.e(TAG, "Couldn't communicate with network policy manager", e);
            }
        }
    }
+2 −2
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class SystemBackupAgent extends BackupAgentHelper {
    private static final String WALLPAPER_IMAGE_KEY = WallpaperBackupHelper.WALLPAPER_IMAGE_KEY;

    private static final Set<String> sEligibleForMultiUser = Sets.newArraySet(
            PERMISSION_HELPER, NOTIFICATION_HELPER, SYNC_SETTINGS_HELPER);
            PERMISSION_HELPER, NOTIFICATION_HELPER, SYNC_SETTINGS_HELPER, NETWORK_POLICY_HELPER);

    private int mUserId = UserHandle.USER_SYSTEM;

@@ -103,7 +103,7 @@ public class SystemBackupAgent extends BackupAgentHelper {
        addHelper(ACCOUNT_MANAGER_HELPER, new AccountManagerBackupHelper());
        addHelper(SLICES_HELPER, new SliceBackupHelper(this));
        addHelper(PEOPLE_HELPER, new PeopleBackupHelper(mUserId));
        addHelper(NETWORK_POLICY_HELPER, new NetworkPolicyBackupHelper());
        addHelper(NETWORK_POLICY_HELPER, new NetworkPolicyBackupHelper(mUserId));
    }

    @Override
+190 −84

File changed.

Preview size limit exceeded, changes collapsed.