Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9158825f authored by Amith Yamasani's avatar Amith Yamasani
Browse files

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
parent 30d03292
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 $(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
# ************************************************
+27 −13
Original line number Diff line number Diff line
@@ -177,7 +177,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);
            }
        }
@@ -197,10 +198,14 @@ public final class AccessibilityManager {
        mHandler = new MyHandler(context.getMainLooper());
        mService = service;
        mUserId = userId;

        if (mService == null) {
            mIsEnabled = false;
        }
        try {
            if (mService != null) {
                final int stateFlags = mService.addClient(mClient, userId);
                setState(stateFlags);
            }
        } catch (RemoteException re) {
            Log.e(LOG_TAG, "AccessibilityManagerService is dead", re);
        }
@@ -322,14 +327,16 @@ public final class AccessibilityManager {
    public List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList() {
        List<AccessibilityServiceInfo> services = null;
        try {
            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;
    }

    /**
@@ -349,14 +356,16 @@ public final class AccessibilityManager {
            int feedbackTypeFlags) {
        List<AccessibilityServiceInfo> services = null;
        try {
            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;
    }

    /**
@@ -466,6 +475,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) {
@@ -482,7 +494,9 @@ public final class AccessibilityManager {
     */
    public void removeAccessibilityInteractionConnection(IWindow windowToken) {
        try {
            if (mService != null) {
                mService.removeAccessibilityInteractionConnection(windowToken);
            }
        } catch (RemoteException re) {
            Log.e(LOG_TAG, "Error while removing an accessibility interaction connection. ", re);
        }
Loading