Merge "Don't backup/restore sim-settings if Telephony not present."
diff --git a/core/api/current.txt b/core/api/current.txt
index 5ec1636..d04012e 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -19384,6 +19384,10 @@
field public static final int ENCODING_IEC61937 = 13; // 0xd
field public static final int ENCODING_INVALID = 0; // 0x0
field public static final int ENCODING_MP3 = 9; // 0x9
+ field public static final int ENCODING_MPEGH_BL_L3 = 23; // 0x17
+ field public static final int ENCODING_MPEGH_BL_L4 = 24; // 0x18
+ field public static final int ENCODING_MPEGH_LC_L3 = 25; // 0x19
+ field public static final int ENCODING_MPEGH_LC_L4 = 26; // 0x1a
field public static final int ENCODING_OPUS = 20; // 0x14
field public static final int ENCODING_PCM_16BIT = 2; // 0x2
field public static final int ENCODING_PCM_24BIT_PACKED = 21; // 0x15
diff --git a/core/java/android/app/AppCompatCallbacks.java b/core/java/android/app/AppCompatCallbacks.java
index 28a21f7..134cef5 100644
--- a/core/java/android/app/AppCompatCallbacks.java
+++ b/core/java/android/app/AppCompatCallbacks.java
@@ -28,7 +28,7 @@
*
* @hide
*/
-public final class AppCompatCallbacks extends Compatibility.Callbacks {
+public final class AppCompatCallbacks implements Compatibility.BehaviorChangeDelegate {
private final long[] mDisabledChanges;
private final ChangeReporter mChangeReporter;
@@ -38,7 +38,7 @@
* @param disabledChanges Set of compatibility changes that are disabled for this process.
*/
public static void install(long[] disabledChanges) {
- Compatibility.setCallbacks(new AppCompatCallbacks(disabledChanges));
+ Compatibility.setBehaviorChangeDelegate(new AppCompatCallbacks(disabledChanges));
}
private AppCompatCallbacks(long[] disabledChanges) {
@@ -48,11 +48,11 @@
ChangeReporter.SOURCE_APP_PROCESS);
}
- protected void reportChange(long changeId) {
+ public void onChangeReported(long changeId) {
reportChange(changeId, ChangeReporter.STATE_LOGGED);
}
- protected boolean isChangeEnabled(long changeId) {
+ public boolean isChangeEnabled(long changeId) {
if (Arrays.binarySearch(mDisabledChanges, changeId) < 0) {
// Not present in the disabled array
reportChange(changeId, ChangeReporter.STATE_ENABLED);
diff --git a/core/java/com/android/internal/colorextraction/OWNERS b/core/java/com/android/internal/colorextraction/OWNERS
new file mode 100644
index 0000000..ffade1e
--- /dev/null
+++ b/core/java/com/android/internal/colorextraction/OWNERS
@@ -0,0 +1,3 @@
+dupin@google.com
+cinek@google.com
+jamesoleary@google.com
diff --git a/core/jni/android_media_AudioFormat.h b/core/jni/android_media_AudioFormat.h
index 5f2dcdf..5630a1e 100644
--- a/core/jni/android_media_AudioFormat.h
+++ b/core/jni/android_media_AudioFormat.h
@@ -41,6 +41,10 @@
#define ENCODING_OPUS 20
#define ENCODING_PCM_24BIT_PACKED 21
#define ENCODING_PCM_32BIT 22
+#define ENCODING_MPEGH_BL_L3 23
+#define ENCODING_MPEGH_BL_L4 24
+#define ENCODING_MPEGH_LC_L3 25
+#define ENCODING_MPEGH_LC_L4 26
#define ENCODING_INVALID 0
#define ENCODING_DEFAULT 1
@@ -98,6 +102,14 @@
return AUDIO_FORMAT_PCM_24_BIT_PACKED;
case ENCODING_PCM_32BIT:
return AUDIO_FORMAT_PCM_32_BIT;
+ case ENCODING_MPEGH_BL_L3:
+ return AUDIO_FORMAT_MPEGH_BL_L3;
+ case ENCODING_MPEGH_BL_L4:
+ return AUDIO_FORMAT_MPEGH_BL_L4;
+ case ENCODING_MPEGH_LC_L3:
+ return AUDIO_FORMAT_MPEGH_LC_L3;
+ case ENCODING_MPEGH_LC_L4:
+ return AUDIO_FORMAT_MPEGH_LC_L4;
default:
return AUDIO_FORMAT_INVALID;
}
@@ -159,6 +171,14 @@
return ENCODING_DOLBY_MAT;
case AUDIO_FORMAT_OPUS:
return ENCODING_OPUS;
+ case AUDIO_FORMAT_MPEGH_BL_L3:
+ return ENCODING_MPEGH_BL_L3;
+ case AUDIO_FORMAT_MPEGH_BL_L4:
+ return ENCODING_MPEGH_BL_L4;
+ case AUDIO_FORMAT_MPEGH_LC_L3:
+ return ENCODING_MPEGH_LC_L3;
+ case AUDIO_FORMAT_MPEGH_LC_L4:
+ return ENCODING_MPEGH_LC_L4;
case AUDIO_FORMAT_DEFAULT:
return ENCODING_DEFAULT;
default:
diff --git a/core/proto/android/providers/OWNERS b/core/proto/android/providers/OWNERS
new file mode 100644
index 0000000..1f5cd9a
--- /dev/null
+++ b/core/proto/android/providers/OWNERS
@@ -0,0 +1 @@
+include /packages/SettingsProvider/OWNERS
diff --git a/media/java/android/media/AudioFormat.java b/media/java/android/media/AudioFormat.java
index 9373676..c77f418 100644
--- a/media/java/android/media/AudioFormat.java
+++ b/media/java/android/media/AudioFormat.java
@@ -316,6 +316,15 @@
* Not guaranteed to be supported by devices, may be emulated if not supported. */
public static final int ENCODING_PCM_32BIT = 22;
+ /** Audio data format: MPEG-H baseline profile, level 3 */
+ public static final int ENCODING_MPEGH_BL_L3 = 23;
+ /** Audio data format: MPEG-H baseline profile, level 4 */
+ public static final int ENCODING_MPEGH_BL_L4 = 24;
+ /** Audio data format: MPEG-H low complexity profile, level 3 */
+ public static final int ENCODING_MPEGH_LC_L3 = 25;
+ /** Audio data format: MPEG-H low complexity profile, level 4 */
+ public static final int ENCODING_MPEGH_LC_L4 = 26;
+
/** @hide */
public static String toLogFriendlyEncoding(int enc) {
switch(enc) {
@@ -363,6 +372,14 @@
return "ENCODING_PCM_24BIT_PACKED";
case ENCODING_PCM_32BIT:
return "ENCODING_PCM_32BIT";
+ case ENCODING_MPEGH_BL_L3:
+ return "ENCODING_MPEGH_BL_L3";
+ case ENCODING_MPEGH_BL_L4:
+ return "ENCODING_MPEGH_BL_L4";
+ case ENCODING_MPEGH_LC_L3:
+ return "ENCODING_MPEGH_LC_L3";
+ case ENCODING_MPEGH_LC_L4:
+ return "ENCODING_MPEGH_LC_L4";
default :
return "invalid encoding " + enc;
}
@@ -638,6 +655,10 @@
case ENCODING_OPUS:
case ENCODING_PCM_24BIT_PACKED:
case ENCODING_PCM_32BIT:
+ case ENCODING_MPEGH_BL_L3:
+ case ENCODING_MPEGH_BL_L4:
+ case ENCODING_MPEGH_LC_L3:
+ case ENCODING_MPEGH_LC_L4:
return true;
default:
return false;
@@ -669,6 +690,10 @@
case ENCODING_OPUS:
case ENCODING_PCM_24BIT_PACKED:
case ENCODING_PCM_32BIT:
+ case ENCODING_MPEGH_BL_L3:
+ case ENCODING_MPEGH_BL_L4:
+ case ENCODING_MPEGH_LC_L3:
+ case ENCODING_MPEGH_LC_L4:
return true;
default:
return false;
@@ -703,6 +728,10 @@
case ENCODING_E_AC3_JOC:
case ENCODING_DOLBY_MAT:
case ENCODING_OPUS:
+ case ENCODING_MPEGH_BL_L3:
+ case ENCODING_MPEGH_BL_L4:
+ case ENCODING_MPEGH_LC_L3:
+ case ENCODING_MPEGH_LC_L4:
return false;
case ENCODING_INVALID:
default:
@@ -737,6 +766,10 @@
case ENCODING_E_AC3_JOC:
case ENCODING_DOLBY_MAT:
case ENCODING_OPUS:
+ case ENCODING_MPEGH_BL_L3:
+ case ENCODING_MPEGH_BL_L4:
+ case ENCODING_MPEGH_LC_L3:
+ case ENCODING_MPEGH_LC_L4:
return false;
case ENCODING_INVALID:
default:
@@ -1019,6 +1052,10 @@
case ENCODING_OPUS:
case ENCODING_PCM_24BIT_PACKED:
case ENCODING_PCM_32BIT:
+ case ENCODING_MPEGH_BL_L3:
+ case ENCODING_MPEGH_BL_L4:
+ case ENCODING_MPEGH_LC_L3:
+ case ENCODING_MPEGH_LC_L4:
mEncoding = encoding;
break;
case ENCODING_INVALID:
@@ -1241,7 +1278,11 @@
ENCODING_DOLBY_MAT,
ENCODING_OPUS,
ENCODING_PCM_24BIT_PACKED,
- ENCODING_PCM_32BIT }
+ ENCODING_PCM_32BIT,
+ ENCODING_MPEGH_BL_L3,
+ ENCODING_MPEGH_BL_L4,
+ ENCODING_MPEGH_LC_L3,
+ ENCODING_MPEGH_LC_L4 }
)
@Retention(RetentionPolicy.SOURCE)
public @interface Encoding {}
@@ -1257,6 +1298,10 @@
ENCODING_AC4,
ENCODING_E_AC3_JOC,
ENCODING_DOLBY_MAT,
+ ENCODING_MPEGH_BL_L3,
+ ENCODING_MPEGH_BL_L4,
+ ENCODING_MPEGH_LC_L3,
+ ENCODING_MPEGH_LC_L4,
};
/** @hide */
@@ -1269,7 +1314,11 @@
ENCODING_DOLBY_TRUEHD,
ENCODING_AC4,
ENCODING_E_AC3_JOC,
- ENCODING_DOLBY_MAT }
+ ENCODING_DOLBY_MAT,
+ ENCODING_MPEGH_BL_L3,
+ ENCODING_MPEGH_BL_L4,
+ ENCODING_MPEGH_LC_L3,
+ ENCODING_MPEGH_LC_L4 }
)
@Retention(RetentionPolicy.SOURCE)
public @interface SurroundSoundEncoding {}
@@ -1303,6 +1352,14 @@
return "Dolby Atmos in Dolby Digital Plus";
case ENCODING_DOLBY_MAT:
return "Dolby MAT";
+ case ENCODING_MPEGH_BL_L3:
+ return "MPEG-H 3D Audio baseline profile level 3";
+ case ENCODING_MPEGH_BL_L4:
+ return "MPEG-H 3D Audio baseline profile level 4";
+ case ENCODING_MPEGH_LC_L3:
+ return "MPEG-H 3D Audio low complexity profile level 3";
+ case ENCODING_MPEGH_LC_L4:
+ return "MPEG-H 3D Audio low complexity profile level 4";
default:
return "Unknown surround sound format";
}
diff --git a/packages/Connectivity/framework/api/module-lib-current.txt b/packages/Connectivity/framework/api/module-lib-current.txt
index 9e2cd3e..8b10fcc 100644
--- a/packages/Connectivity/framework/api/module-lib-current.txt
+++ b/packages/Connectivity/framework/api/module-lib-current.txt
@@ -11,7 +11,7 @@
method @Nullable public android.net.ProxyInfo getGlobalProxy();
method @NonNull public static android.util.Range<java.lang.Integer> getIpSecNetIdRange();
method @NonNull public static String getPrivateDnsMode(@NonNull android.content.Context);
- method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void registerDefaultNetworkCallbackAsUid(int, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
+ method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void registerDefaultNetworkCallbackForUid(int, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void registerSystemDefaultNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void requestBackgroundNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
method @Deprecated public boolean requestRouteToHostAddress(int, java.net.InetAddress);
@@ -166,11 +166,11 @@
public final class VpnTransportInfo implements android.os.Parcelable android.net.TransportInfo {
ctor public VpnTransportInfo(int, @Nullable String);
method public int describeContents();
+ method @Nullable public String getSessionId();
+ method public int getType();
method @NonNull public android.net.VpnTransportInfo makeCopy(long);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.VpnTransportInfo> CREATOR;
- field @Nullable public final String sessionId;
- field public final int type;
}
}
diff --git a/packages/Connectivity/framework/api/system-current.txt b/packages/Connectivity/framework/api/system-current.txt
index 935b093..5750845 100644
--- a/packages/Connectivity/framework/api/system-current.txt
+++ b/packages/Connectivity/framework/api/system-current.txt
@@ -238,7 +238,7 @@
method public final void sendQosSessionLost(int, int, int);
method public final void sendSocketKeepaliveEvent(int, int);
method @Deprecated public void setLegacySubtype(int, @NonNull String);
- method public void setTeardownDelayMs(@IntRange(from=0, to=0x1388) int);
+ method public void setTeardownDelayMillis(@IntRange(from=0, to=0x1388) int);
method public final void setUnderlyingNetworks(@Nullable java.util.List<android.net.Network>);
method public void unregister();
field public static final int VALIDATION_STATUS_NOT_VALID = 2; // 0x2
diff --git a/packages/Connectivity/framework/src/android/net/ConnectivityManager.java b/packages/Connectivity/framework/src/android/net/ConnectivityManager.java
index 4dd0984c..4636abb 100644
--- a/packages/Connectivity/framework/src/android/net/ConnectivityManager.java
+++ b/packages/Connectivity/framework/src/android/net/ConnectivityManager.java
@@ -4418,7 +4418,7 @@
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
public void registerDefaultNetworkCallback(@NonNull NetworkCallback networkCallback,
@NonNull Handler handler) {
- registerDefaultNetworkCallbackAsUid(Process.INVALID_UID, networkCallback, handler);
+ registerDefaultNetworkCallbackForUid(Process.INVALID_UID, networkCallback, handler);
}
/**
@@ -4448,7 +4448,7 @@
@RequiresPermission(anyOf = {
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
android.Manifest.permission.NETWORK_SETTINGS})
- public void registerDefaultNetworkCallbackAsUid(int uid,
+ public void registerDefaultNetworkCallbackForUid(int uid,
@NonNull NetworkCallback networkCallback, @NonNull Handler handler) {
CallbackHandler cbHandler = new CallbackHandler(handler);
sendRequestForNetwork(uid, null /* need */, networkCallback, 0 /* timeoutMs */,
diff --git a/packages/Connectivity/framework/src/android/net/NetworkAgent.java b/packages/Connectivity/framework/src/android/net/NetworkAgent.java
index c57da53..f65acdd 100644
--- a/packages/Connectivity/framework/src/android/net/NetworkAgent.java
+++ b/packages/Connectivity/framework/src/android/net/NetworkAgent.java
@@ -879,11 +879,11 @@
* This method may be called at any time while the network is connected. It has no effect if
* the network is already disconnected and the teardown delay timer is running.
*
- * @param teardownDelayMs the teardown delay to set, or 0 to disable teardown delay.
+ * @param teardownDelayMillis the teardown delay to set, or 0 to disable teardown delay.
*/
- public void setTeardownDelayMs(
- @IntRange(from = 0, to = MAX_TEARDOWN_DELAY_MS) int teardownDelayMs) {
- queueOrSendMessage(reg -> reg.sendTeardownDelayMs(teardownDelayMs));
+ public void setTeardownDelayMillis(
+ @IntRange(from = 0, to = MAX_TEARDOWN_DELAY_MS) int teardownDelayMillis) {
+ queueOrSendMessage(reg -> reg.sendTeardownDelayMs(teardownDelayMillis));
}
/**
diff --git a/packages/Connectivity/framework/src/android/net/VpnTransportInfo.java b/packages/Connectivity/framework/src/android/net/VpnTransportInfo.java
index efd3363..4071c9a 100644
--- a/packages/Connectivity/framework/src/android/net/VpnTransportInfo.java
+++ b/packages/Connectivity/framework/src/android/net/VpnTransportInfo.java
@@ -40,10 +40,10 @@
@SystemApi(client = MODULE_LIBRARIES)
public final class VpnTransportInfo implements TransportInfo, Parcelable {
/** Type of this VPN. */
- public final int type;
+ private final int mType;
@Nullable
- public final String sessionId;
+ private final String mSessionId;
@Override
public @RedactionType long getApplicableRedactions() {
@@ -55,13 +55,28 @@
*/
@NonNull
public VpnTransportInfo makeCopy(@RedactionType long redactions) {
- return new VpnTransportInfo(type,
- ((redactions & REDACT_FOR_NETWORK_SETTINGS) != 0) ? null : sessionId);
+ return new VpnTransportInfo(mType,
+ ((redactions & REDACT_FOR_NETWORK_SETTINGS) != 0) ? null : mSessionId);
}
public VpnTransportInfo(int type, @Nullable String sessionId) {
- this.type = type;
- this.sessionId = sessionId;
+ this.mType = type;
+ this.mSessionId = sessionId;
+ }
+
+ /**
+ * Returns the session Id of this VpnTransportInfo.
+ */
+ @Nullable
+ public String getSessionId() {
+ return mSessionId;
+ }
+
+ /**
+ * Returns the type of this VPN.
+ */
+ public int getType() {
+ return mType;
}
@Override
@@ -69,17 +84,17 @@
if (!(o instanceof VpnTransportInfo)) return false;
VpnTransportInfo that = (VpnTransportInfo) o;
- return (this.type == that.type) && TextUtils.equals(this.sessionId, that.sessionId);
+ return (this.mType == that.mType) && TextUtils.equals(this.mSessionId, that.mSessionId);
}
@Override
public int hashCode() {
- return Objects.hash(type, sessionId);
+ return Objects.hash(mType, mSessionId);
}
@Override
public String toString() {
- return String.format("VpnTransportInfo{type=%d, sessionId=%s}", type, sessionId);
+ return String.format("VpnTransportInfo{type=%d, sessionId=%s}", mType, mSessionId);
}
@Override
@@ -89,8 +104,8 @@
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
- dest.writeInt(type);
- dest.writeString(sessionId);
+ dest.writeInt(mType);
+ dest.writeString(mSessionId);
}
public static final @NonNull Creator<VpnTransportInfo> CREATOR =
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 88a1917..1ab03aa 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -8664,7 +8664,7 @@
if (vpn == null) return VpnManager.TYPE_VPN_NONE;
final TransportInfo ti = vpn.networkCapabilities.getTransportInfo();
if (!(ti instanceof VpnTransportInfo)) return VpnManager.TYPE_VPN_NONE;
- return ((VpnTransportInfo) ti).type;
+ return ((VpnTransportInfo) ti).getType();
}
/**
@@ -9593,7 +9593,8 @@
// request.
final ArrayList<NetworkRequest> nrs = new ArrayList<>();
nrs.add(createNetworkRequest(NetworkRequest.Type.REQUEST, pref.capabilities));
- nrs.add(createDefaultRequest());
+ nrs.add(createDefaultInternetRequestForTransport(
+ TYPE_NONE, NetworkRequest.Type.TRACK_DEFAULT));
setNetworkRequestUids(nrs, UidRange.fromIntRanges(pref.capabilities.getUids()));
final NetworkRequestInfo nri = new NetworkRequestInfo(Process.myUid(), nrs);
result.add(nri);
@@ -9898,7 +9899,8 @@
case OemNetworkPreferences.OEM_NETWORK_PREFERENCE_OEM_PAID:
requests.add(createUnmeteredNetworkRequest());
requests.add(createOemPaidNetworkRequest());
- requests.add(createDefaultRequest());
+ requests.add(createDefaultInternetRequestForTransport(
+ TYPE_NONE, NetworkRequest.Type.TRACK_DEFAULT));
break;
case OemNetworkPreferences.OEM_NETWORK_PREFERENCE_OEM_PAID_NO_FALLBACK:
requests.add(createUnmeteredNetworkRequest());
diff --git a/tests/backup/Android.mk b/tests/backup/Android.mk
index 9b155c9..b6f3471 100644
--- a/tests/backup/Android.mk
+++ b/tests/backup/Android.mk
@@ -47,4 +47,7 @@
LOCAL_PROGUARD_ENABLED := disabled
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../NOTICE
include $(BUILD_PACKAGE)
diff --git a/tests/net/java/android/net/ConnectivityManagerTest.java b/tests/net/java/android/net/ConnectivityManagerTest.java
index 19f8843..591e0cc 100644
--- a/tests/net/java/android/net/ConnectivityManagerTest.java
+++ b/tests/net/java/android/net/ConnectivityManagerTest.java
@@ -379,7 +379,7 @@
eq(testPkgName), eq(testAttributionTag));
reset(mService);
- manager.registerDefaultNetworkCallbackAsUid(42, callback, handler);
+ manager.registerDefaultNetworkCallbackForUid(42, callback, handler);
verify(mService).requestNetwork(eq(42), eq(null),
eq(TRACK_DEFAULT.ordinal()), any(), anyInt(), any(), eq(TYPE_NONE), anyInt(),
eq(testPkgName), eq(testAttributionTag));
diff --git a/tests/net/java/android/net/VpnTransportInfoTest.java b/tests/net/java/android/net/VpnTransportInfoTest.java
index fee65f0..ccaa5cf 100644
--- a/tests/net/java/android/net/VpnTransportInfoTest.java
+++ b/tests/net/java/android/net/VpnTransportInfoTest.java
@@ -63,6 +63,6 @@
assertEquals(v31, v32);
assertEquals(v11.hashCode(), v13.hashCode());
assertEquals(REDACT_FOR_NETWORK_SETTINGS, v32.getApplicableRedactions());
- assertEquals(session1, v15.makeCopy(REDACT_NONE).sessionId);
+ assertEquals(session1, v15.makeCopy(REDACT_NONE).getSessionId());
}
}
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index 8bf98b4..557f0d2 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -1400,7 +1400,7 @@
final TransportInfo ti = nc.getTransportInfo();
assertTrue("VPN TransportInfo is not a VpnTransportInfo: " + ti,
ti instanceof VpnTransportInfo);
- assertEquals(type, ((VpnTransportInfo) ti).type);
+ assertEquals(type, ((VpnTransportInfo) ti).getType());
}
@@ -2928,7 +2928,7 @@
callback.expectAvailableCallbacksUnvalidated(mWiFiNetworkAgent);
// Set teardown delay and make sure CS has processed it.
- mWiFiNetworkAgent.getNetworkAgent().setTeardownDelayMs(300);
+ mWiFiNetworkAgent.getNetworkAgent().setTeardownDelayMillis(300);
waitForIdle();
// Post the duringTeardown lambda to the handler so it fires while teardown is in progress.
@@ -4216,7 +4216,7 @@
() -> mCm.registerSystemDefaultNetworkCallback(callback, handler));
callback.assertNoCallback();
assertThrows(SecurityException.class,
- () -> mCm.registerDefaultNetworkCallbackAsUid(APP1_UID, callback, handler));
+ () -> mCm.registerDefaultNetworkCallbackForUid(APP1_UID, callback, handler));
callback.assertNoCallback();
mServiceContext.setPermission(NETWORK_SETTINGS, PERMISSION_GRANTED);
@@ -4224,7 +4224,7 @@
callback.expectAvailableCallbacksUnvalidated(mCellNetworkAgent);
mCm.unregisterNetworkCallback(callback);
- mCm.registerDefaultNetworkCallbackAsUid(APP1_UID, callback, handler);
+ mCm.registerDefaultNetworkCallbackForUid(APP1_UID, callback, handler);
callback.expectAvailableCallbacksUnvalidated(mCellNetworkAgent);
mCm.unregisterNetworkCallback(callback);
}
@@ -5600,7 +5600,7 @@
for (int i = 0; i < SYSTEM_ONLY_MAX_REQUESTS - 1; i++) {
NetworkCallback cb = new NetworkCallback();
if (i % 2 == 0) {
- mCm.registerDefaultNetworkCallbackAsUid(1000000 + i, cb, handler);
+ mCm.registerDefaultNetworkCallbackForUid(1000000 + i, cb, handler);
} else {
mCm.registerNetworkCallback(networkRequest, cb);
}
@@ -5609,7 +5609,7 @@
waitForIdle();
assertThrows(TooManyRequestsException.class, () ->
- mCm.registerDefaultNetworkCallbackAsUid(1001042, new NetworkCallback(),
+ mCm.registerDefaultNetworkCallbackForUid(1001042, new NetworkCallback(),
handler));
assertThrows(TooManyRequestsException.class, () ->
mCm.registerNetworkCallback(networkRequest, new NetworkCallback()));
@@ -5662,7 +5662,7 @@
withPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, () -> {
for (int i = 0; i < MAX_REQUESTS; i++) {
NetworkCallback networkCallback = new NetworkCallback();
- mCm.registerDefaultNetworkCallbackAsUid(1000000 + i, networkCallback,
+ mCm.registerDefaultNetworkCallbackForUid(1000000 + i, networkCallback,
new Handler(ConnectivityThread.getInstanceLooper()));
mCm.unregisterNetworkCallback(networkCallback);
}
@@ -7747,7 +7747,7 @@
registerDefaultNetworkCallbackAsUid(vpnUidDefaultCallback, VPN_UID);
final TestNetworkCallback vpnDefaultCallbackAsUid = new TestNetworkCallback();
- mCm.registerDefaultNetworkCallbackAsUid(VPN_UID, vpnDefaultCallbackAsUid,
+ mCm.registerDefaultNetworkCallbackForUid(VPN_UID, vpnDefaultCallbackAsUid,
new Handler(ConnectivityThread.getInstanceLooper()));
final int uid = Process.myUid();
@@ -10323,7 +10323,7 @@
assertTrue(mRequests.get(0).hasCapability(NET_CAPABILITY_VALIDATED));
assertTrue(mRequests.get(1).isRequest());
assertTrue(mRequests.get(1).hasCapability(NET_CAPABILITY_OEM_PAID));
- assertTrue(mRequests.get(2).isRequest());
+ assertEquals(NetworkRequest.Type.TRACK_DEFAULT, mRequests.get(2).type);
assertTrue(mService.getDefaultRequest().networkCapabilities.equalsNetCapabilities(
mRequests.get(2).networkCapabilities));
}
@@ -10835,7 +10835,7 @@
final TestNetworkCallback otherUidDefaultCallback = new TestNetworkCallback();
withPermission(NETWORK_SETTINGS, () ->
- mCm.registerDefaultNetworkCallbackAsUid(TEST_PACKAGE_UID, otherUidDefaultCallback,
+ mCm.registerDefaultNetworkCallbackForUid(TEST_PACKAGE_UID, otherUidDefaultCallback,
new Handler(ConnectivityThread.getInstanceLooper())));
// Setup the test process to use networkPref for their default network.
@@ -10883,7 +10883,7 @@
final TestNetworkCallback otherUidDefaultCallback = new TestNetworkCallback();
withPermission(NETWORK_SETTINGS, () ->
- mCm.registerDefaultNetworkCallbackAsUid(TEST_PACKAGE_UID, otherUidDefaultCallback,
+ mCm.registerDefaultNetworkCallbackForUid(TEST_PACKAGE_UID, otherUidDefaultCallback,
new Handler(ConnectivityThread.getInstanceLooper())));
// Bring up ethernet with OEM_PAID. This will satisfy NET_CAPABILITY_OEM_PAID.
@@ -10925,7 +10925,7 @@
final TestNetworkCallback otherUidDefaultCallback = new TestNetworkCallback();
withPermission(NETWORK_SETTINGS, () ->
- mCm.registerDefaultNetworkCallbackAsUid(TEST_PACKAGE_UID, otherUidDefaultCallback,
+ mCm.registerDefaultNetworkCallbackForUid(TEST_PACKAGE_UID, otherUidDefaultCallback,
new Handler(ConnectivityThread.getInstanceLooper())));
// Setup a process different than the test process to use the default network. This means
diff --git a/tests/net/java/com/android/server/connectivity/VpnTest.java b/tests/net/java/com/android/server/connectivity/VpnTest.java
index 6ad4900..b725b82 100644
--- a/tests/net/java/com/android/server/connectivity/VpnTest.java
+++ b/tests/net/java/com/android/server/connectivity/VpnTest.java
@@ -1023,7 +1023,7 @@
assertNotNull(nc);
VpnTransportInfo ti = (VpnTransportInfo) nc.getTransportInfo();
assertNotNull(ti);
- assertEquals(type, ti.type);
+ assertEquals(type, ti.getType());
}
public void startRacoon(final String serverAddr, final String expectedAddr)