am 7f416631
: Merge "Check feature bits before loading optional services" into klp-modular-dev
* commit '7f416631413e75a1756bd316a2e1906725d72f24': Check feature bits before loading optional services
This commit is contained in:
@ -18,8 +18,6 @@ include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-subdir-Iaidl-files)
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := services
|
||||
|
||||
LOCAL_PACKAGE_NAME := Keyguard
|
||||
|
||||
LOCAL_CERTIFICATE := platform
|
||||
|
@ -1,27 +1,23 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
# the java library
|
||||
# merge all required services into one jar
|
||||
# ============================================================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES :=
|
||||
LOCAL_MODULE := services
|
||||
|
||||
# TODO: Move this to the product makefiles
|
||||
REQUIRED_SERVICES := core accessibility appwidget backup devicepolicy print
|
||||
LOCAL_SRC_FILES := $(call all-java-files-under,java)
|
||||
|
||||
include $(patsubst %,$(LOCAL_PATH)/%/java/service.mk,$(REQUIRED_SERVICES))
|
||||
|
||||
LOCAL_MODULE:= services
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := android.policy conscrypt telephony-common
|
||||
|
||||
#LOCAL_PROGUARD_ENABLED := full
|
||||
#LOCAL_PROGUARD_FLAG_FILES := proguard.flags
|
||||
LOCAL_STATIC_JAVA_LIBRARIES := \
|
||||
services.core \
|
||||
services.accessibility \
|
||||
services.appwidget \
|
||||
services.backup \
|
||||
services.devicepolicy \
|
||||
services.print
|
||||
|
||||
include $(BUILD_JAVA_LIBRARY)
|
||||
|
||||
include $(BUILD_DROIDDOC)
|
||||
|
||||
# native library
|
||||
# =============================================================
|
||||
|
||||
|
10
services/accessibility/Android.mk
Normal file
10
services/accessibility/Android.mk
Normal file
@ -0,0 +1,10 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := services.accessibility
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,java)
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
@ -1,11 +0,0 @@
|
||||
# Include only if the service is required
|
||||
ifneq ($(findstring accessibility,$(REQUIRED_SERVICES)),)
|
||||
|
||||
SUB_DIR := accessibility/java
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,$(SUB_DIR))
|
||||
|
||||
#DEFINED_SERVICES += com.android.server.accessibility.AccessibilityManagerService
|
||||
|
||||
endif
|
10
services/appwidget/Android.mk
Normal file
10
services/appwidget/Android.mk
Normal file
@ -0,0 +1,10 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := services.appwidget
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,java)
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
@ -1,11 +0,0 @@
|
||||
# Include only if the service is required
|
||||
ifneq ($(findstring appwidget,$(REQUIRED_SERVICES)),)
|
||||
|
||||
SUB_DIR := appwidget/java
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,$(SUB_DIR))
|
||||
|
||||
#DEFINED_SERVICES += com.android.server.appwidget.AppWidgetService
|
||||
|
||||
endif
|
12
services/backup/Android.mk
Normal file
12
services/backup/Android.mk
Normal file
@ -0,0 +1,12 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := services.backup
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,java)
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := services.core
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
@ -1,11 +0,0 @@
|
||||
# Include only if the service is required
|
||||
ifneq ($(findstring backup,$(REQUIRED_SERVICES)),)
|
||||
|
||||
SUB_DIR := backup/java
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,$(SUB_DIR))
|
||||
|
||||
#DEFINED_SERVICES += com.android.server.backup.BackupManagerService
|
||||
|
||||
endif
|
14
services/core/Android.mk
Normal file
14
services/core/Android.mk
Normal file
@ -0,0 +1,14 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := services.core
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,java) \
|
||||
java/com/android/server/EventLogTags.logtags \
|
||||
java/com/android/server/am/EventLogTags.logtags
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := android.policy telephony-common
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
@ -50,7 +50,6 @@ import com.android.server.AppOpsService;
|
||||
import com.android.server.AttributeCache;
|
||||
import com.android.server.IntentResolver;
|
||||
import com.android.server.ServiceThread;
|
||||
import com.android.server.SystemServer;
|
||||
import com.android.server.SystemService;
|
||||
import com.android.server.Watchdog;
|
||||
import com.android.server.am.ActivityStack.ActivityState;
|
||||
|
@ -1,6 +0,0 @@
|
||||
SUB_DIR := core/java
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,$(SUB_DIR)) \
|
||||
$(SUB_DIR)/com/android/server/EventLogTags.logtags \
|
||||
$(SUB_DIR)/com/android/server/am/EventLogTags.logtags
|
12
services/devicepolicy/Android.mk
Normal file
12
services/devicepolicy/Android.mk
Normal file
@ -0,0 +1,12 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := services.devicepolicy
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,java)
|
||||
|
||||
LOCAL_JAVA_LIBRARIES := conscrypt
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
@ -1,11 +0,0 @@
|
||||
# Include only if the service is required
|
||||
ifneq ($(findstring devicepolicy,$(REQUIRED_SERVICES)),)
|
||||
|
||||
SUB_DIR := devicepolicy/java
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,$(SUB_DIR))
|
||||
|
||||
#DEFINED_SERVICES += com.android.server.devicepolicy.DevicePolicyManagerService
|
||||
|
||||
endif
|
@ -52,7 +52,6 @@ import android.view.WindowManager;
|
||||
import com.android.internal.R;
|
||||
import com.android.internal.os.BinderInternal;
|
||||
import com.android.internal.os.SamplingProfilerIntegration;
|
||||
import com.android.server.accessibility.AccessibilityManagerService;
|
||||
import com.android.server.accounts.AccountManagerService;
|
||||
import com.android.server.am.ActivityManagerService;
|
||||
import com.android.server.am.BatteryStatsService;
|
||||
@ -482,8 +481,8 @@ public final class SystemServer {
|
||||
|
||||
try {
|
||||
Slog.i(TAG, "Accessibility Manager");
|
||||
ServiceManager.addService(Context.ACCESSIBILITY_SERVICE,
|
||||
new AccessibilityManagerService(context));
|
||||
ServiceManager.addService(Context.ACCESSIBILITY_SERVICE, (IBinder)
|
||||
getClass().getClassLoader().loadClass("com.android.server.accessibility.AccessibilityManagerService").getConstructor(Context.class).newInstance(context));
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting Accessibility Manager", e);
|
||||
}
|
||||
@ -536,8 +535,10 @@ public final class SystemServer {
|
||||
}
|
||||
|
||||
try {
|
||||
Slog.i(TAG, "Device Policy");
|
||||
mSystemServiceManager.startServiceIfExists(DEVICE_POLICY_MANAGER_SERVICE_CLASS);
|
||||
if (pm.hasSystemFeature("android.software.device_admin")) {
|
||||
mSystemServiceManager.startServiceIfExists(
|
||||
DEVICE_POLICY_MANAGER_SERVICE_CLASS);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting DevicePolicyService", e);
|
||||
}
|
||||
@ -787,15 +788,17 @@ public final class SystemServer {
|
||||
|
||||
if (!disableNonCoreServices) {
|
||||
try {
|
||||
Slog.i(TAG, "Backup Service");
|
||||
mSystemServiceManager.startServiceIfExists(BACKUP_MANAGER_SERVICE_CLASS);
|
||||
if (pm.hasSystemFeature("android.software.backup")) {
|
||||
mSystemServiceManager.startServiceIfExists(BACKUP_MANAGER_SERVICE_CLASS);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Slog.e(TAG, "Failure starting Backup Service", e);
|
||||
}
|
||||
|
||||
try {
|
||||
Slog.i(TAG, "AppWidget Service");
|
||||
mSystemServiceManager.startServiceIfExists(APPWIDGET_SERVICE_CLASS);
|
||||
if (pm.hasSystemFeature("android.software.app_widgets")) {
|
||||
mSystemServiceManager.startServiceIfExists(APPWIDGET_SERVICE_CLASS);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting AppWidget Service", e);
|
||||
}
|
||||
@ -855,7 +858,7 @@ public final class SystemServer {
|
||||
}
|
||||
}
|
||||
|
||||
if (!disableNonCoreServices &&
|
||||
if (!disableNonCoreServices &&
|
||||
context.getResources().getBoolean(R.bool.config_dreamsSupported)) {
|
||||
try {
|
||||
Slog.i(TAG, "Dreams Service");
|
||||
@ -885,8 +888,9 @@ public final class SystemServer {
|
||||
}
|
||||
|
||||
try {
|
||||
Slog.i(TAG, "Print Service");
|
||||
mSystemServiceManager.startServiceIfExists(PRINT_MANAGER_SERVICE_CLASS);
|
||||
if (pm.hasSystemFeature("android.software.print")) {
|
||||
mSystemServiceManager.startServiceIfExists(PRINT_MANAGER_SERVICE_CLASS);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
reportWtf("starting Print Service", e);
|
||||
}
|
10
services/print/Android.mk
Normal file
10
services/print/Android.mk
Normal file
@ -0,0 +1,10 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := services.print
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,java)
|
||||
|
||||
include $(BUILD_STATIC_JAVA_LIBRARY)
|
@ -52,7 +52,6 @@ import com.android.internal.R;
|
||||
import com.android.internal.content.PackageMonitor;
|
||||
import com.android.internal.os.BackgroundThread;
|
||||
import com.android.server.SystemService;
|
||||
import com.android.server.devicepolicy.DevicePolicyManagerService;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
|
@ -1,11 +0,0 @@
|
||||
# Include only if the service is required
|
||||
ifneq ($(findstring print,$(REQUIRED_SERVICES)),)
|
||||
|
||||
SUB_DIR := print/java
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
$(call all-java-files-under,$(SUB_DIR))
|
||||
|
||||
#DEFINED_SERVICES += com.android.server.print.PrintManagerService
|
||||
|
||||
endif
|
Reference in New Issue
Block a user