Park RemoteAuth Manager and Service

Limit the amount of parked code built into Connectivity module

Test: built successfully.
Bug: 300522527
Change-Id: I87d7516011c469aa89fc7e67cf03c4ee8aa1bb9b
This commit is contained in:
Igor Zaslavsky
2023-09-21 09:26:31 +00:00
parent 487191dbe6
commit e336586353
4 changed files with 3 additions and 28 deletions

View File

@@ -51,7 +51,7 @@ java_defaults {
":framework-connectivity-tiramisu-updatable-sources",
":framework-nearby-java-sources",
":framework-thread-sources",
] + framework_remoteauth_srcs,
],
libs: [
"unsupportedappusage",
"app-compat-annotations",
@@ -126,7 +126,6 @@ java_sdk_library {
"enable-framework-connectivity-t-targets",
"FlaggedApiDefaults",
],
api_srcs: framework_remoteauth_api_srcs,
// Do not add static_libs to this library: put them in framework-connectivity instead.
// The jarjar rules are only so that references to jarjared utils in
// framework-connectivity-pre-jarjar match at runtime.
@@ -143,10 +142,8 @@ java_sdk_library {
"android.net",
"android.net.nsd",
"android.nearby",
"android.remoteauth",
"com.android.connectivity",
"com.android.nearby",
"com.android.remoteauth",
],
hidden_api: {

View File

@@ -18,7 +18,7 @@ package {
filegroup {
name: "remoteauth-service-srcs",
srcs: ["java/**/*.java"],
srcs: [],
}
// Main lib for remoteauth services.

View File

@@ -26,7 +26,7 @@ android_test {
min_sdk_version: "31",
// Include all test java files.
srcs: ["src/**/*.java"],
srcs: [],
libs: [
"android.test.base",

View File

@@ -28,7 +28,6 @@ import com.android.server.connectivity.ConnectivityNativeService;
import com.android.server.ethernet.EthernetService;
import com.android.server.ethernet.EthernetServiceImpl;
import com.android.server.nearby.NearbyService;
import com.android.server.remoteauth.RemoteAuthService;
import com.android.server.thread.ThreadNetworkService;
/**
@@ -43,7 +42,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
private final NsdService mNsdService;
private final NearbyService mNearbyService;
private final EthernetServiceImpl mEthernetServiceImpl;
private final RemoteAuthService mRemoteAuthService;
private final ThreadNetworkService mThreadNetworkService;
public ConnectivityServiceInitializer(Context context) {
@@ -56,7 +54,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
mConnectivityNative = createConnectivityNativeService(context);
mNsdService = createNsdService(context);
mNearbyService = createNearbyService(context);
mRemoteAuthService = createRemoteAuthService(context);
mThreadNetworkService = createThreadNetworkService(context);
}
@@ -94,12 +91,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
/* allowIsolated= */ false);
}
if (mRemoteAuthService != null) {
Log.i(TAG, "Registering " + RemoteAuthService.SERVICE_NAME);
publishBinderService(RemoteAuthService.SERVICE_NAME, mRemoteAuthService,
/* allowIsolated= */ false);
}
if (mThreadNetworkService != null) {
Log.i(TAG, "Registering " + ThreadNetworkManager.SERVICE_NAME);
publishBinderService(ThreadNetworkManager.SERVICE_NAME, mThreadNetworkService,
@@ -164,19 +155,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
}
}
/** Return RemoteAuth service instance */
private RemoteAuthService createRemoteAuthService(final Context context) {
if (!SdkLevel.isAtLeastV()) return null;
try {
return new RemoteAuthService(context);
} catch (UnsupportedOperationException e) {
// RemoteAuth is not yet supported in all branches
// TODO: remove catch clause when it is available.
Log.i(TAG, "Skipping unsupported service " + RemoteAuthService.SERVICE_NAME);
return null;
}
}
/**
* Return EthernetServiceImpl instance or null if current SDK is lower than T or Ethernet
* service isn't necessary.