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

Commit 9a20fa54 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Background data notification, API clean up."

parents 1797d608 3a844fcf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -11431,7 +11431,7 @@ package android.net {
    method public android.net.NetworkInfo getActiveNetworkInfo();
    method public android.net.NetworkQuotaInfo getActiveNetworkQuotaInfo();
    method public android.net.NetworkInfo[] getAllNetworkInfo();
    method public boolean getBackgroundDataSetting();
    method public deprecated boolean getBackgroundDataSetting();
    method public android.net.NetworkInfo getNetworkInfo(int);
    method public int getNetworkPreference();
    method public static boolean isNetworkTypeValid(int);
@@ -17087,7 +17087,7 @@ package android.provider {
    field public static final java.lang.String ALLOWED_GEOLOCATION_ORIGINS = "allowed_geolocation_origins";
    field public static final java.lang.String ALLOW_MOCK_LOCATION = "mock_location";
    field public static final java.lang.String ANDROID_ID = "android_id";
    field public static final java.lang.String BACKGROUND_DATA = "background_data";
    field public static final deprecated java.lang.String BACKGROUND_DATA = "background_data";
    field public static final java.lang.String BLUETOOTH_ON = "bluetooth_on";
    field public static final android.net.Uri CONTENT_URI;
    field public static final java.lang.String DATA_ROAMING = "data_roaming";
+12 −10
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static com.android.internal.util.Preconditions.checkNotNull;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.os.Binder;
import android.os.Build.VERSION_CODES;
import android.os.RemoteException;

import java.net.InetAddress;
@@ -503,16 +504,19 @@ public class ConnectivityManager {
     * <p>
     * All applications that have background services that use the network
     * should listen to {@link #ACTION_BACKGROUND_DATA_SETTING_CHANGED}.
     * <p>
     * As of {@link VERSION_CODES#ICE_CREAM_SANDWICH}, availability of
     * background data depends on several combined factors, and this method will
     * always return {@code true}. Instead, when background data is unavailable,
     * {@link #getActiveNetworkInfo()} will now appear disconnected.
     *
     * @return Whether background data usage is allowed.
     */
    @Deprecated
    public boolean getBackgroundDataSetting() {
        try {
            return mService.getBackgroundDataSetting();
        } catch (RemoteException e) {
            // Err on the side of safety
            return false;
        }
        // assume that background data is allowed; final authority is
        // NetworkInfo which may be blocked.
        return true;
    }

    /**
@@ -525,11 +529,9 @@ public class ConnectivityManager {
     * @see #getBackgroundDataSetting()
     * @hide
     */
    @Deprecated
    public void setBackgroundDataSetting(boolean allowBackgroundData) {
        try {
            mService.setBackgroundDataSetting(allowBackgroundData);
        } catch (RemoteException e) {
        }
        // ignored
    }

    /**
+0 −4
Original line number Diff line number Diff line
@@ -63,10 +63,6 @@ interface IConnectivityManager

    boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);

    boolean getBackgroundDataSetting();

    void setBackgroundDataSetting(boolean allowBackgroundData);

    boolean getMobileDataEnabled();

    void setMobileDataEnabled(boolean enabled);
+1 −0
Original line number Diff line number Diff line
@@ -3081,6 +3081,7 @@ public final class Settings {
         * Whether background data usage is allowed by the user. See
         * ConnectivityManager for more info.
         */
        @Deprecated
        public static final String BACKGROUND_DATA = "background_data";

        /**
+6 −1
Original line number Diff line number Diff line
@@ -3099,7 +3099,7 @@
    <!-- Notification title when mobile data usage has exceeded limit threshold, and has been disabled. [CHAR LIMIT=32] -->
    <string name="data_usage_mobile_limit_title">Mobile data disabled</string>
    <!-- Notification body when data usage has exceeded limit threshold, and has been disabled. [CHAR LIMIT=32] -->
    <string name="data_usage_limit_body">tap to enable</string>
    <string name="data_usage_limit_body">Touch to enable</string>

    <!-- Notification title when 2G-3G data usage has exceeded limit threshold. [CHAR LIMIT=32] -->
    <string name="data_usage_3g_limit_snoozed_title">2G-3G data limit exceeded</string>
@@ -3110,6 +3110,11 @@
    <!-- Notification body when data usage has exceeded limit threshold. [CHAR LIMIT=32] -->
    <string name="data_usage_limit_snoozed_body"><xliff:g id="size" example="3.8GB">%s</xliff:g> over specified limit</string>

    <!-- Notification title when background data usage is limited. [CHAR LIMIT=32] -->
    <string name="data_usage_restricted_title">Background data restricted</string>
    <!-- Notification body when background data usage is limited. [CHAR LIMIT=32] -->
    <string name="data_usage_restricted_body">Touch to remove restriction</string>

    <!-- SSL Certificate dialogs -->
    <!-- Title for an SSL Certificate dialog -->
    <string name="ssl_certificate">Security certificate</string>
Loading