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

Commit b6a0decb authored by Chalard Jean's avatar Chalard Jean
Browse files

Remove unused methods from NetworkManagementService.

More methods are unused, but they are marked @UnsupportedAppUsage
and therefore aren't removed by this patch.

Also address warnings :
• member can be final
• deprecated NetworkStack permission check methods
• redundant public modifier

Test: TH
Bug: 64955351
Merged-In: Ib0d4e8c6a063ed57c5a790eab3868ed4fe9cf096
Change-Id: Ib0d4e8c6a063ed57c5a790eab3868ed4fe9cf096
parent c11454b4
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -29,12 +29,6 @@ import android.net.NetworkStats;
 * @hide
 */
interface ITetheringStatsProvider {
    // Returns cumulative statistics for all tethering sessions since boot, on all upstreams.
    // @code {how} is one of the NetworkStats.STATS_PER_* constants. If {@code how} is
    // {@code STATS_PER_IFACE}, the provider should not include any traffic that is already
    // counted by kernel interface counters.
    NetworkStats getTetherStats(int how);

    // Sets the interface quota for the specified upstream interface. This is defined as the number
    // of bytes, starting from zero and counting from now, after which data should stop being
    // forwarded to/from the specified upstream. A value of QUOTA_UNLIMITED means there is no limit.
+0 −67
Original line number Diff line number Diff line
@@ -142,14 +142,6 @@ interface INetworkManagementService
    @UnsupportedAppUsage
    void startTethering(in String[] dhcpRanges);

    /**
     * Start tethering services with the specified dhcp server range and
     * DNS proxy config.
     * {@code boolean} is used to control legacy DNS proxy server.
     * {@code String[]} is a set of start end pairs defining the ranges.
     */
    void startTetheringWithConfiguration(boolean usingLegacyDnsProxy, in String[] dhcpRanges);

    /**
     * Stop currently running tethering services
     */
@@ -180,23 +172,6 @@ interface INetworkManagementService
    @UnsupportedAppUsage
    String[] listTetheredInterfaces();

    /**
     * Returns the list of DNS forwarders (in order of priority)
     */
    String[] getDnsForwarders();

    /**
     * Enables unidirectional packet forwarding from {@code fromIface} to
     * {@code toIface}.
     */
    void startInterfaceForwarding(String fromIface, String toIface);

    /**
     * Disables unidirectional packet forwarding from {@code fromIface} to
     * {@code toIface}.
     */
    void stopInterfaceForwarding(String fromIface, String toIface);

    /**
     *  Enables Network Address Translation between two interfaces.
     *  The address and netmask of the external interface is used for
@@ -211,42 +186,10 @@ interface INetworkManagementService
    @UnsupportedAppUsage
    void disableNat(String internalInterface, String externalInterface);

    /**
     * Registers a {@code ITetheringStatsProvider} to provide tethering statistics.
     * All registered providers will be called in order, and their results will be added together.
     * Netd is always registered as a tethering stats provider.
     */
    void registerTetheringStatsProvider(ITetheringStatsProvider provider, String name);

    /**
     * Unregisters a previously-registered {@code ITetheringStatsProvider}.
     */
    void unregisterTetheringStatsProvider(ITetheringStatsProvider provider);

    /**
     * Reports that a tethering provider has reached a data limit.
     *
     * Currently triggers a global alert, which causes NetworkStatsService to poll counters and
     * re-evaluate data usage.
     *
     * This does not take an interface name because:
     * 1. The tethering offload stats provider cannot reliably determine the interface on which the
     *    limit was reached, because the HAL does not provide it.
     * 2. Firing an interface-specific alert instead of a global alert isn't really useful since in
     *    all cases of interest, the system responds to both in the same way - it polls stats, and
     *    then notifies NetworkPolicyManagerService of the fact.
     */
    void tetherLimitReached(ITetheringStatsProvider provider);

    /**
     ** DATA USAGE RELATED
     **/

    /**
     * Return summary of network statistics all tethering interfaces.
     */
    NetworkStats getNetworkStatsTethering(int how);

    /**
     * Set quota for an interface.
     */
@@ -267,11 +210,6 @@ interface INetworkManagementService
     */
    void removeInterfaceAlert(String iface);

    /**
     * Set alert across all interfaces.
     */
    void setGlobalAlert(long alertBytes);

    /**
     * Control network activity of a UID over interfaces with a quota limit.
     */
@@ -289,7 +227,6 @@ interface INetworkManagementService

    void setFirewallEnabled(boolean enabled);
    boolean isFirewallEnabled();
    void setFirewallInterfaceRule(String iface, boolean allow);
    void setFirewallUidRule(int chain, int uid, int rule);
    void setFirewallUidRules(int chain, in int[] uids, in int[] rules);
    void setFirewallChainEnabled(int chain, boolean enable);
@@ -304,9 +241,5 @@ interface INetworkManagementService
     */
    void denyProtect(int uid);

    void addInterfaceToLocalNetwork(String iface, in List<RouteInfo> routes);
    void removeInterfaceFromLocalNetwork(String iface);
    int removeRoutesFromLocalNetwork(in List<RouteInfo> routes);

    boolean isNetworkRestricted(int uid);
}
+43 −245

File changed.

Preview size limit exceeded, changes collapsed.