am 9158825f: Move some system services to separate directories

* commit '9158825f9c41869689d6b1786d7c7aa8bdd524ce':
  Move some system services to separate directories
This commit is contained in:
Amith Yamasani
2013-12-19 23:30:35 +00:00
committed by Android Git Automerger
357 changed files with 217 additions and 95 deletions

View File

@@ -185,7 +185,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 $(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/services_intermediates)
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************

View File

@@ -213,7 +213,8 @@ public final class AccessibilityManager {
userId = UserHandle.myUserId();
}
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);
}
}
@@ -233,10 +234,14 @@ public final class AccessibilityManager {
mHandler = new MyHandler(context.getMainLooper());
mService = service;
mUserId = userId;
if (mService == null) {
mIsEnabled = false;
}
try {
final int stateFlags = mService.addClient(mClient, userId);
setState(stateFlags);
if (mService != null) {
final int stateFlags = mService.addClient(mClient, userId);
setState(stateFlags);
}
} catch (RemoteException re) {
Log.e(LOG_TAG, "AccessibilityManagerService is dead", re);
}
@@ -358,14 +363,16 @@ public final class AccessibilityManager {
public List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList() {
List<AccessibilityServiceInfo> services = null;
try {
services = mService.getInstalledAccessibilityServiceList(mUserId);
if (DEBUG) {
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
if (mService != null) {
services = mService.getInstalledAccessibilityServiceList(mUserId);
if (DEBUG) {
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
}
}
} catch (RemoteException 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;
}
/**
@@ -385,14 +392,16 @@ public final class AccessibilityManager {
int feedbackTypeFlags) {
List<AccessibilityServiceInfo> services = null;
try {
services = mService.getEnabledAccessibilityServiceList(feedbackTypeFlags, mUserId);
if (DEBUG) {
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
if (mService != null) {
services = mService.getEnabledAccessibilityServiceList(feedbackTypeFlags, mUserId);
if (DEBUG) {
Log.i(LOG_TAG, "Installed AccessibilityServices " + services);
}
}
} catch (RemoteException 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;
}
/**
@@ -502,6 +511,9 @@ public final class AccessibilityManager {
*/
public int addAccessibilityInteractionConnection(IWindow windowToken,
IAccessibilityInteractionConnection connection) {
if (mService == null) {
return View.NO_ID;
}
try {
return mService.addAccessibilityInteractionConnection(windowToken, connection, mUserId);
} catch (RemoteException re) {
@@ -518,7 +530,9 @@ public final class AccessibilityManager {
*/
public void removeAccessibilityInteractionConnection(IWindow windowToken) {
try {
mService.removeAccessibilityInteractionConnection(windowToken);
if (mService != null) {
mService.removeAccessibilityInteractionConnection(windowToken);
}
} catch (RemoteException re) {
Log.e(LOG_TAG, "Error while removing an accessibility interaction connection. ", re);
}

45
services/Android.mk Normal file
View 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)

View 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

View 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

View 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