Move some system services to separate directories
Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
This commit is contained in:
@ -184,7 +184,7 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/)
|
|||||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/effects/)
|
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/media/audio/effects/)
|
||||||
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/framework-res_intermediates)
|
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/framework-res_intermediates)
|
||||||
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/print/IPrintClient.*)
|
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java/android/print/IPrintClient.*)
|
||||||
|
$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/services_intermediates)
|
||||||
# ************************************************
|
# ************************************************
|
||||||
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
|
||||||
# ************************************************
|
# ************************************************
|
||||||
|
@ -177,7 +177,8 @@ public final class AccessibilityManager {
|
|||||||
userId = UserHandle.myUserId();
|
userId = UserHandle.myUserId();
|
||||||
}
|
}
|
||||||
IBinder iBinder = ServiceManager.getService(Context.ACCESSIBILITY_SERVICE);
|
IBinder iBinder = ServiceManager.getService(Context.ACCESSIBILITY_SERVICE);
|
||||||
IAccessibilityManager service = IAccessibilityManager.Stub.asInterface(iBinder);
|
IAccessibilityManager service = iBinder == null
|
||||||
|
? null : IAccessibilityManager.Stub.asInterface(iBinder);
|
||||||
sInstance = new AccessibilityManager(context, service, userId);
|
sInstance = new AccessibilityManager(context, service, userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,10 +198,14 @@ public final class AccessibilityManager {
|
|||||||
mHandler = new MyHandler(context.getMainLooper());
|
mHandler = new MyHandler(context.getMainLooper());
|
||||||
mService = service;
|
mService = service;
|
||||||
mUserId = userId;
|
mUserId = userId;
|
||||||
|
if (mService == null) {
|
||||||
|
mIsEnabled = false;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
final int stateFlags = mService.addClient(mClient, userId);
|
if (mService != null) {
|
||||||
setState(stateFlags);
|
final int stateFlags = mService.addClient(mClient, userId);
|
||||||
|
setState(stateFlags);
|
||||||
|
}
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
Log.e(LOG_TAG, "AccessibilityManagerService is dead", re);
|
Log.e(LOG_TAG, "AccessibilityManagerService is dead", re);
|
||||||
}
|
}
|
||||||
@ -322,14 +327,16 @@ public final class AccessibilityManager {
|
|||||||
public List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList() {
|
public List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList() {
|
||||||
List<AccessibilityServiceInfo> services = null;
|
List<AccessibilityServiceInfo> services = null;
|
||||||
try {
|
try {
|
||||||
services = mService.getInstalledAccessibilityServiceList(mUserId);
|
if (mService != null) {
|
||||||
if (DEBUG) {
|
services = mService.getInstalledAccessibilityServiceList(mUserId);
|
||||||
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
|
if (DEBUG) {
|
||||||
|
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
Log.e(LOG_TAG, "Error while obtaining the installed AccessibilityServices. ", re);
|
Log.e(LOG_TAG, "Error while obtaining the installed AccessibilityServices. ", re);
|
||||||
}
|
}
|
||||||
return Collections.unmodifiableList(services);
|
return services != null ? Collections.unmodifiableList(services) : Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -349,14 +356,16 @@ public final class AccessibilityManager {
|
|||||||
int feedbackTypeFlags) {
|
int feedbackTypeFlags) {
|
||||||
List<AccessibilityServiceInfo> services = null;
|
List<AccessibilityServiceInfo> services = null;
|
||||||
try {
|
try {
|
||||||
services = mService.getEnabledAccessibilityServiceList(feedbackTypeFlags, mUserId);
|
if (mService != null) {
|
||||||
if (DEBUG) {
|
services = mService.getEnabledAccessibilityServiceList(feedbackTypeFlags, mUserId);
|
||||||
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
|
if (DEBUG) {
|
||||||
|
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
Log.e(LOG_TAG, "Error while obtaining the installed AccessibilityServices. ", re);
|
Log.e(LOG_TAG, "Error while obtaining the installed AccessibilityServices. ", re);
|
||||||
}
|
}
|
||||||
return Collections.unmodifiableList(services);
|
return services != null ? Collections.unmodifiableList(services) : Collections.EMPTY_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -466,6 +475,9 @@ public final class AccessibilityManager {
|
|||||||
*/
|
*/
|
||||||
public int addAccessibilityInteractionConnection(IWindow windowToken,
|
public int addAccessibilityInteractionConnection(IWindow windowToken,
|
||||||
IAccessibilityInteractionConnection connection) {
|
IAccessibilityInteractionConnection connection) {
|
||||||
|
if (mService == null) {
|
||||||
|
return View.NO_ID;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return mService.addAccessibilityInteractionConnection(windowToken, connection, mUserId);
|
return mService.addAccessibilityInteractionConnection(windowToken, connection, mUserId);
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
@ -482,7 +494,9 @@ public final class AccessibilityManager {
|
|||||||
*/
|
*/
|
||||||
public void removeAccessibilityInteractionConnection(IWindow windowToken) {
|
public void removeAccessibilityInteractionConnection(IWindow windowToken) {
|
||||||
try {
|
try {
|
||||||
mService.removeAccessibilityInteractionConnection(windowToken);
|
if (mService != null) {
|
||||||
|
mService.removeAccessibilityInteractionConnection(windowToken);
|
||||||
|
}
|
||||||
} catch (RemoteException re) {
|
} catch (RemoteException re) {
|
||||||
Log.e(LOG_TAG, "Error while removing an accessibility interaction connection. ", re);
|
Log.e(LOG_TAG, "Error while removing an accessibility interaction connection. ", re);
|
||||||
}
|
}
|
||||||
|
45
services/Android.mk
Normal file
45
services/Android.mk
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
LOCAL_PATH:= $(call my-dir)
|
||||||
|
|
||||||
|
# the java library
|
||||||
|
# ============================================================
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES :=
|
||||||
|
|
||||||
|
# TODO: Move this to the product makefiles
|
||||||
|
REQUIRED_SERVICES := core appwidget backup devicepolicy accessibility print
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
include $(BUILD_JAVA_LIBRARY)
|
||||||
|
|
||||||
|
include $(BUILD_DROIDDOC)
|
||||||
|
|
||||||
|
# native library
|
||||||
|
# =============================================================
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES :=
|
||||||
|
LOCAL_SHARED_LIBRARIES :=
|
||||||
|
|
||||||
|
# include all the jni subdirs to collect their sources
|
||||||
|
include $(wildcard $(LOCAL_PATH)/*/jni/Android.mk)
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
|
||||||
|
|
||||||
|
ifeq ($(WITH_MALLOC_LEAK_CHECK),true)
|
||||||
|
LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_MODULE:= libandroid_servers
|
||||||
|
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
11
services/accessibility/java/service.mk
Normal file
11
services/accessibility/java/service.mk
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 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
|
11
services/appwidget/java/service.mk
Normal file
11
services/appwidget/java/service.mk
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 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
|
11
services/backup/java/service.mk
Normal file
11
services/backup/java/service.mk
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 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
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user