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:
@@ -51,7 +51,7 @@ java_defaults {
|
|||||||
":framework-connectivity-tiramisu-updatable-sources",
|
":framework-connectivity-tiramisu-updatable-sources",
|
||||||
":framework-nearby-java-sources",
|
":framework-nearby-java-sources",
|
||||||
":framework-thread-sources",
|
":framework-thread-sources",
|
||||||
] + framework_remoteauth_srcs,
|
],
|
||||||
libs: [
|
libs: [
|
||||||
"unsupportedappusage",
|
"unsupportedappusage",
|
||||||
"app-compat-annotations",
|
"app-compat-annotations",
|
||||||
@@ -126,7 +126,6 @@ java_sdk_library {
|
|||||||
"enable-framework-connectivity-t-targets",
|
"enable-framework-connectivity-t-targets",
|
||||||
"FlaggedApiDefaults",
|
"FlaggedApiDefaults",
|
||||||
],
|
],
|
||||||
api_srcs: framework_remoteauth_api_srcs,
|
|
||||||
// Do not add static_libs to this library: put them in framework-connectivity instead.
|
// 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
|
// The jarjar rules are only so that references to jarjared utils in
|
||||||
// framework-connectivity-pre-jarjar match at runtime.
|
// framework-connectivity-pre-jarjar match at runtime.
|
||||||
@@ -143,10 +142,8 @@ java_sdk_library {
|
|||||||
"android.net",
|
"android.net",
|
||||||
"android.net.nsd",
|
"android.net.nsd",
|
||||||
"android.nearby",
|
"android.nearby",
|
||||||
"android.remoteauth",
|
|
||||||
"com.android.connectivity",
|
"com.android.connectivity",
|
||||||
"com.android.nearby",
|
"com.android.nearby",
|
||||||
"com.android.remoteauth",
|
|
||||||
],
|
],
|
||||||
|
|
||||||
hidden_api: {
|
hidden_api: {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ package {
|
|||||||
|
|
||||||
filegroup {
|
filegroup {
|
||||||
name: "remoteauth-service-srcs",
|
name: "remoteauth-service-srcs",
|
||||||
srcs: ["java/**/*.java"],
|
srcs: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main lib for remoteauth services.
|
// Main lib for remoteauth services.
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ android_test {
|
|||||||
min_sdk_version: "31",
|
min_sdk_version: "31",
|
||||||
|
|
||||||
// Include all test java files.
|
// Include all test java files.
|
||||||
srcs: ["src/**/*.java"],
|
srcs: [],
|
||||||
|
|
||||||
libs: [
|
libs: [
|
||||||
"android.test.base",
|
"android.test.base",
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import com.android.server.connectivity.ConnectivityNativeService;
|
|||||||
import com.android.server.ethernet.EthernetService;
|
import com.android.server.ethernet.EthernetService;
|
||||||
import com.android.server.ethernet.EthernetServiceImpl;
|
import com.android.server.ethernet.EthernetServiceImpl;
|
||||||
import com.android.server.nearby.NearbyService;
|
import com.android.server.nearby.NearbyService;
|
||||||
import com.android.server.remoteauth.RemoteAuthService;
|
|
||||||
import com.android.server.thread.ThreadNetworkService;
|
import com.android.server.thread.ThreadNetworkService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,7 +42,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
|
|||||||
private final NsdService mNsdService;
|
private final NsdService mNsdService;
|
||||||
private final NearbyService mNearbyService;
|
private final NearbyService mNearbyService;
|
||||||
private final EthernetServiceImpl mEthernetServiceImpl;
|
private final EthernetServiceImpl mEthernetServiceImpl;
|
||||||
private final RemoteAuthService mRemoteAuthService;
|
|
||||||
private final ThreadNetworkService mThreadNetworkService;
|
private final ThreadNetworkService mThreadNetworkService;
|
||||||
|
|
||||||
public ConnectivityServiceInitializer(Context context) {
|
public ConnectivityServiceInitializer(Context context) {
|
||||||
@@ -56,7 +54,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
|
|||||||
mConnectivityNative = createConnectivityNativeService(context);
|
mConnectivityNative = createConnectivityNativeService(context);
|
||||||
mNsdService = createNsdService(context);
|
mNsdService = createNsdService(context);
|
||||||
mNearbyService = createNearbyService(context);
|
mNearbyService = createNearbyService(context);
|
||||||
mRemoteAuthService = createRemoteAuthService(context);
|
|
||||||
mThreadNetworkService = createThreadNetworkService(context);
|
mThreadNetworkService = createThreadNetworkService(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,12 +91,6 @@ public final class ConnectivityServiceInitializer extends SystemService {
|
|||||||
/* allowIsolated= */ false);
|
/* allowIsolated= */ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRemoteAuthService != null) {
|
|
||||||
Log.i(TAG, "Registering " + RemoteAuthService.SERVICE_NAME);
|
|
||||||
publishBinderService(RemoteAuthService.SERVICE_NAME, mRemoteAuthService,
|
|
||||||
/* allowIsolated= */ false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mThreadNetworkService != null) {
|
if (mThreadNetworkService != null) {
|
||||||
Log.i(TAG, "Registering " + ThreadNetworkManager.SERVICE_NAME);
|
Log.i(TAG, "Registering " + ThreadNetworkManager.SERVICE_NAME);
|
||||||
publishBinderService(ThreadNetworkManager.SERVICE_NAME, mThreadNetworkService,
|
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
|
* Return EthernetServiceImpl instance or null if current SDK is lower than T or Ethernet
|
||||||
* service isn't necessary.
|
* service isn't necessary.
|
||||||
|
|||||||
Reference in New Issue
Block a user