Loading packages/CrashRecovery/adaptor/Android.bp 0 → 100644 +12 −0 Original line number Diff line number Diff line filegroup { name: "crashrecovery-platform-adaptor-srcs", srcs: select(soong_config_variable("ANDROID", "release_crashrecovery_module"), { "true": [ "postModularization/java/**/*.java", ], default: [ "preModularization/java/**/*.java", ], }), visibility: ["//frameworks/base:__subpackages__"], } packages/CrashRecovery/adaptor/postModularization/java/com/android/server/crashrecovery/CrashRecoveryAdaptor.java 0 → 100644 +72 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.crashrecovery; import android.content.Context; import com.android.server.PackageWatchdog; import com.android.server.SystemServiceManager; import java.util.List; /** * This class mediates calls to hidden APIs in CrashRecovery module. * This class is used when the CrashRecovery classes are moved to separate module. * * @hide */ public class CrashRecoveryAdaptor { private static final String TAG = "CrashRecoveryAdaptor"; private static final String CRASHRECOVERY_MODULE_LIFECYCLE_CLASS = "com.android.server.crashrecovery.CrashRecoveryModule$Lifecycle"; /** Start CrashRecoveryModule LifeCycleService */ public static void initializeCrashrecoveryModuleService( SystemServiceManager mSystemServiceManager) { mSystemServiceManager.startService(CRASHRECOVERY_MODULE_LIFECYCLE_CLASS); } /** Does Nothing */ public static void packageWatchdogNoteBoot(Context mSystemContext) { // do nothing } /** Does Nothing */ public static void packageWatchdogWriteNow(Context mContext) { // do nothing } /** Does Nothing */ public static void packageWatchdogOnPackagesReady(PackageWatchdog mPackageWatchdog) { // do nothing } /** Does Nothing */ public static void rescuePartyRegisterHealthObserver(Context mSystemContext) { // do nothing } /** Does Nothing */ public static void rescuePartyOnSettingsProviderPublished(Context mContext) { // do nothing } /** Does Nothing */ public static void rescuePartyResetDeviceConfigForPackages(List<String> packageNames) { // do nothing } } packages/CrashRecovery/adaptor/preModularization/java/com/android/server/crashrecovery/CrashRecoveryAdaptor.java 0 → 100644 +71 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.crashrecovery; import android.content.Context; import com.android.server.PackageWatchdog; import com.android.server.RescueParty; import com.android.server.SystemServiceManager; import java.util.List; /** * This class mediates calls to hidden APIs in CrashRecovery module. * This class is used when CrashRecovery classes are still in platform. * * @hide */ public class CrashRecoveryAdaptor { private static final String TAG = "CrashRecoveryAdaptor"; /** Start CrashRecoveryModule LifeCycleService */ public static void initializeCrashrecoveryModuleService( SystemServiceManager mSystemServiceManager) { mSystemServiceManager.startService(CrashRecoveryModule.Lifecycle.class); } /** Forward calls to PackageWatchdog noteboot */ public static void packageWatchdogNoteBoot(Context mSystemContext) { PackageWatchdog.getInstance(mSystemContext).noteBoot(); } /** Forward calls to PackageWatchdog writeNow */ public static void packageWatchdogWriteNow(Context mContext) { PackageWatchdog.getInstance(mContext).writeNow(); } /** Forward calls to PackageWatchdog OnPackagesReady */ public static void packageWatchdogOnPackagesReady(PackageWatchdog mPackageWatchdog) { mPackageWatchdog.onPackagesReady(); } /** Forward calls to RescueParty RegisterHealthObserver */ public static void rescuePartyRegisterHealthObserver(Context mSystemContext) { RescueParty.registerHealthObserver(mSystemContext); } /** Forward calls to RescueParty OnSettingsProviderPublished */ public static void rescuePartyOnSettingsProviderPublished(Context mContext) { RescueParty.onSettingsProviderPublished(mContext); } /** Forward calls to RescueParty ResetDeviceConfigForPackages */ public static void rescuePartyResetDeviceConfigForPackages(List<String> packageNames) { RescueParty.resetDeviceConfigForPackages(packageNames); } } packages/CrashRecovery/services/Android.bp +10 −46 Original line number Diff line number Diff line soong_config_module_type { name: "platform_filegroup", module_type: "filegroup", config_namespace: "ANDROID", bool_variables: [ "crashrecovery_files_in_platform", ], properties: [ "srcs", ], } platform_filegroup { filegroup { name: "services-crashrecovery-sources", soong_config_variables: { // if this flag is enabled, then files are part of platform crashrecovery_files_in_platform: { srcs: [ "java/**/*.java", "java/**/*.aidl", ":crashrecovery-platform-adaptor-srcs", ":statslog-crashrecovery-java-gen", ], }, }, ] + select(soong_config_variable("ANDROID", "release_crashrecovery_module"), { "true": [], default: ["platform/java/**/*.java"], }), visibility: ["//frameworks/base:__subpackages__"], } soong_config_module_type { name: "module_filegroup", module_type: "filegroup", config_namespace: "ANDROID", bool_variables: [ "crashrecovery_files_in_module", ], properties: [ "srcs", ], } module_filegroup { filegroup { name: "services-crashrecovery-module-sources", soong_config_variables: { // if this flag is enabled, then files are part of module crashrecovery_files_in_module: { srcs: [ "java/**/*.java", "java/**/*.aidl", ":statslog-crashrecovery-java-gen", ], }, }, srcs: ["module/java/**/*.java"], visibility: ["//packages/modules/CrashRecovery/service"], } Loading services/core/java/com/android/server/ExplicitHealthCheckController.java→packages/CrashRecovery/services/module/java/com/android/server/ExplicitHealthCheckController.java +0 −0 File moved. View file Loading
packages/CrashRecovery/adaptor/Android.bp 0 → 100644 +12 −0 Original line number Diff line number Diff line filegroup { name: "crashrecovery-platform-adaptor-srcs", srcs: select(soong_config_variable("ANDROID", "release_crashrecovery_module"), { "true": [ "postModularization/java/**/*.java", ], default: [ "preModularization/java/**/*.java", ], }), visibility: ["//frameworks/base:__subpackages__"], }
packages/CrashRecovery/adaptor/postModularization/java/com/android/server/crashrecovery/CrashRecoveryAdaptor.java 0 → 100644 +72 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.crashrecovery; import android.content.Context; import com.android.server.PackageWatchdog; import com.android.server.SystemServiceManager; import java.util.List; /** * This class mediates calls to hidden APIs in CrashRecovery module. * This class is used when the CrashRecovery classes are moved to separate module. * * @hide */ public class CrashRecoveryAdaptor { private static final String TAG = "CrashRecoveryAdaptor"; private static final String CRASHRECOVERY_MODULE_LIFECYCLE_CLASS = "com.android.server.crashrecovery.CrashRecoveryModule$Lifecycle"; /** Start CrashRecoveryModule LifeCycleService */ public static void initializeCrashrecoveryModuleService( SystemServiceManager mSystemServiceManager) { mSystemServiceManager.startService(CRASHRECOVERY_MODULE_LIFECYCLE_CLASS); } /** Does Nothing */ public static void packageWatchdogNoteBoot(Context mSystemContext) { // do nothing } /** Does Nothing */ public static void packageWatchdogWriteNow(Context mContext) { // do nothing } /** Does Nothing */ public static void packageWatchdogOnPackagesReady(PackageWatchdog mPackageWatchdog) { // do nothing } /** Does Nothing */ public static void rescuePartyRegisterHealthObserver(Context mSystemContext) { // do nothing } /** Does Nothing */ public static void rescuePartyOnSettingsProviderPublished(Context mContext) { // do nothing } /** Does Nothing */ public static void rescuePartyResetDeviceConfigForPackages(List<String> packageNames) { // do nothing } }
packages/CrashRecovery/adaptor/preModularization/java/com/android/server/crashrecovery/CrashRecoveryAdaptor.java 0 → 100644 +71 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.crashrecovery; import android.content.Context; import com.android.server.PackageWatchdog; import com.android.server.RescueParty; import com.android.server.SystemServiceManager; import java.util.List; /** * This class mediates calls to hidden APIs in CrashRecovery module. * This class is used when CrashRecovery classes are still in platform. * * @hide */ public class CrashRecoveryAdaptor { private static final String TAG = "CrashRecoveryAdaptor"; /** Start CrashRecoveryModule LifeCycleService */ public static void initializeCrashrecoveryModuleService( SystemServiceManager mSystemServiceManager) { mSystemServiceManager.startService(CrashRecoveryModule.Lifecycle.class); } /** Forward calls to PackageWatchdog noteboot */ public static void packageWatchdogNoteBoot(Context mSystemContext) { PackageWatchdog.getInstance(mSystemContext).noteBoot(); } /** Forward calls to PackageWatchdog writeNow */ public static void packageWatchdogWriteNow(Context mContext) { PackageWatchdog.getInstance(mContext).writeNow(); } /** Forward calls to PackageWatchdog OnPackagesReady */ public static void packageWatchdogOnPackagesReady(PackageWatchdog mPackageWatchdog) { mPackageWatchdog.onPackagesReady(); } /** Forward calls to RescueParty RegisterHealthObserver */ public static void rescuePartyRegisterHealthObserver(Context mSystemContext) { RescueParty.registerHealthObserver(mSystemContext); } /** Forward calls to RescueParty OnSettingsProviderPublished */ public static void rescuePartyOnSettingsProviderPublished(Context mContext) { RescueParty.onSettingsProviderPublished(mContext); } /** Forward calls to RescueParty ResetDeviceConfigForPackages */ public static void rescuePartyResetDeviceConfigForPackages(List<String> packageNames) { RescueParty.resetDeviceConfigForPackages(packageNames); } }
packages/CrashRecovery/services/Android.bp +10 −46 Original line number Diff line number Diff line soong_config_module_type { name: "platform_filegroup", module_type: "filegroup", config_namespace: "ANDROID", bool_variables: [ "crashrecovery_files_in_platform", ], properties: [ "srcs", ], } platform_filegroup { filegroup { name: "services-crashrecovery-sources", soong_config_variables: { // if this flag is enabled, then files are part of platform crashrecovery_files_in_platform: { srcs: [ "java/**/*.java", "java/**/*.aidl", ":crashrecovery-platform-adaptor-srcs", ":statslog-crashrecovery-java-gen", ], }, }, ] + select(soong_config_variable("ANDROID", "release_crashrecovery_module"), { "true": [], default: ["platform/java/**/*.java"], }), visibility: ["//frameworks/base:__subpackages__"], } soong_config_module_type { name: "module_filegroup", module_type: "filegroup", config_namespace: "ANDROID", bool_variables: [ "crashrecovery_files_in_module", ], properties: [ "srcs", ], } module_filegroup { filegroup { name: "services-crashrecovery-module-sources", soong_config_variables: { // if this flag is enabled, then files are part of module crashrecovery_files_in_module: { srcs: [ "java/**/*.java", "java/**/*.aidl", ":statslog-crashrecovery-java-gen", ], }, }, srcs: ["module/java/**/*.java"], visibility: ["//packages/modules/CrashRecovery/service"], } Loading
services/core/java/com/android/server/ExplicitHealthCheckController.java→packages/CrashRecovery/services/module/java/com/android/server/ExplicitHealthCheckController.java +0 −0 File moved. View file