Merge "[Tether04] Migrate EntitlementManager into module"

This commit is contained in:
Mark Chien
2019-10-31 07:33:21 +00:00
committed by Gerrit Code Review
6 changed files with 26 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ java_defaults {
"src/**/*.java",
":framework-tethering-shared-srcs",
":services-tethering-shared-srcs",
":servicescore-tethering-src",
],
static_libs: [
"androidx.annotation_annotation",
@@ -67,9 +68,17 @@ android_app {
// This group will be removed when tethering migration is done.
filegroup {
name: "tethering-services-srcs",
name: "tethering-servicescore-srcs",
srcs: [
"src/com/android/server/connectivity/tethering/EntitlementManager.java",
"src/com/android/server/connectivity/tethering/TetheringConfiguration.java",
],
}
// This group will be removed when tethering migration is done.
filegroup {
name: "tethering-servicesnet-srcs",
srcs: [
"src/android/net/dhcp/DhcpServerCallbacks.java",
"src/android/net/dhcp/DhcpServingParamsParcelExt.java",
"src/android/net/ip/IpServer.java",

View File

@@ -87,7 +87,6 @@ public class EntitlementManager {
private static final int EVENT_MAYBE_RUN_PROVISIONING = 3;
private static final int EVENT_GET_ENTITLEMENT_VALUE = 4;
// The ArraySet contains enabled downstream types, ex:
// {@link ConnectivityManager.TETHERING_WIFI}
// {@link ConnectivityManager.TETHERING_USB}
@@ -112,7 +111,6 @@ public class EntitlementManager {
public EntitlementManager(Context ctx, StateMachine tetherMasterSM, SharedLog log,
int permissionChangeMessageCode, MockableSystemProperties systemProperties) {
mContext = ctx;
mLog = log.forSubComponent(TAG);
mCurrentTethers = new ArraySet<Integer>();
@@ -138,7 +136,7 @@ public class EntitlementManager {
/**
* Ui entitlement check fails in |downstream|.
*
* @param downstream tethering type from ConnectivityManager.TETHERING_{@code *}.
* @param downstream tethering type from ConnectivityManager.TETHERING_{@code *}.
*/
void onUiEntitlementFailed(int downstream);
}
@@ -662,7 +660,6 @@ public class EntitlementManager {
private void handleGetLatestTetheringEntitlementValue(int downstream, ResultReceiver receiver,
boolean showEntitlementUi) {
final TetheringConfiguration config = mFetcher.fetchTetheringConfiguration();
if (!isTetherProvisioningRequired(config)) {
receiver.send(TETHER_ERROR_NO_ERROR, null);

View File

@@ -17,7 +17,10 @@
android_test {
name: "TetheringTests",
certificate: "platform",
srcs: ["src/**/*.java"],
srcs: [
":servicescore-tethering-src",
"src/**/*.java",
],
test_suites: ["device-tests"],
static_libs: [
"androidx.test.rules",
@@ -42,6 +45,7 @@ android_test {
filegroup {
name: "tethering-tests-src",
srcs: [
"src/com/android/server/connectivity/tethering/EntitlementManagerTest.java",
"src/com/android/server/connectivity/tethering/TetheringConfigurationTest.java",
"src/android/net/dhcp/DhcpServingParamsParcelExtTest.java",
"src/android/net/ip/IpServerTest.java",

View File

@@ -20,6 +20,7 @@ java_library_static {
":vold_aidl",
":gsiservice_aidl",
":platform-compat-config",
":tethering-servicescore-srcs",
"java/com/android/server/EventLogTags.logtags",
"java/com/android/server/am/EventLogTags.logtags",
"java/com/android/server/policy/EventLogTags.logtags",
@@ -81,3 +82,11 @@ prebuilt_etc {
name: "gps_debug.conf",
src: "java/com/android/server/location/gps_debug.conf",
}
// TODO: this should be removed after tethering migration done.
filegroup {
name: "servicescore-tethering-src",
srcs: [
"java/com/android/server/connectivity/MockableSystemProperties.java",
],
}

View File

@@ -1,7 +1,7 @@
java_library_static {
name: "services.net",
srcs: [
":tethering-services-srcs",
":tethering-servicesnet-srcs",
"java/**/*.java",
],
static_libs: [