IT. Expert System.

Android Reference

NetworkPolicyManager


android.net

Class NetworkPolicyManager



  • public class NetworkPolicyManager
    extends Object
    Manager for creating and modifying network policy rules.
    • Field Detail

      • POLICY_NONE

        public static final int POLICY_NONE
        No specific network policy, use system default.
        See Also:
        Constant Field Values
      • POLICY_REJECT_METERED_BACKGROUND

        public static final int POLICY_REJECT_METERED_BACKGROUND
        Reject network usage on metered networks when application in background.
        See Also:
        Constant Field Values
      • RULE_ALLOW_ALL

        public static final int RULE_ALLOW_ALL
        All network traffic should be allowed.
        See Also:
        Constant Field Values
      • RULE_REJECT_METERED

        public static final int RULE_REJECT_METERED
        Reject traffic on metered networks.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NetworkPolicyManager

        public NetworkPolicyManager(INetworkPolicyManager service)
    • Method Detail

      • getUidPolicy

        public int getUidPolicy(int uid)
      • getUidsWithPolicy

        public int[] getUidsWithPolicy(int policy)
      • registerListener

        public void registerListener(INetworkPolicyListener listener)
      • unregisterListener

        public void unregisterListener(INetworkPolicyListener listener)
      • setNetworkPolicies

        public void setNetworkPolicies(NetworkPolicy[] policies)
      • setRestrictBackground

        public void setRestrictBackground(boolean restrictBackground)
      • getRestrictBackground

        public boolean getRestrictBackground()
      • computeLastCycleBoundary

        public static long computeLastCycleBoundary(long currentTime,
                                    NetworkPolicy policy)
        Compute the last cycle boundary for the given NetworkPolicy. For example, if cycle day is 20th, and today is June 15th, it will return May 20th. When cycle day doesn't exist in current month, it snaps to the 1st of following month.
      • computeNextCycleBoundary

        public static long computeNextCycleBoundary(long currentTime,
                                    NetworkPolicy policy)
      • snapToCycleDay

        public static void snapToCycleDay(Time time,
                          int cycleDay)
        Snap to the cycle day for the current month given; when cycle day doesn't exist, it snaps to last second of current month.
      • isUidValidForPolicy

        @Deprecated
        public static boolean isUidValidForPolicy(Context context,
                                             int uid)
        Deprecated.
        Check if given UID can have a setUidPolicy(int, int) defined, usually to protect critical system services.
      • dumpPolicy

        public static void dumpPolicy(PrintWriter fout,
                      int policy)
      • dumpRules

        public static void dumpRules(PrintWriter fout,
                     int rules)


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 463 / 158669830. Delta: 0.03216 с