Search in sources :

Example 1 with IOverlayManager

use of android.content.om.IOverlayManager in project android_frameworks_base by DirtyUnicorns.

the class ActivityManagerService method disableOverlays.

public final void disableOverlays() {
    try {
        IOverlayManager iom = IOverlayManager.Stub.asInterface(ServiceManager.getService("overlay"));
        if (iom == null) {
            return;
        }
        Log.d(TAG, "Contacting the Overlay Manager Service for the list of enabled overlays");
        Map<String, List<OverlayInfo>> allOverlays = iom.getAllOverlays(UserHandle.USER_SYSTEM);
        if (allOverlays != null) {
            Log.d(TAG, "The Overlay Manager Service provided the list of enabled overlays");
            Set<String> set = allOverlays.keySet();
            for (String targetPackageName : set) {
                for (OverlayInfo oi : allOverlays.get(targetPackageName)) {
                    if (oi.isEnabled()) {
                        iom.setEnabled(oi.packageName, false, UserHandle.USER_SYSTEM, false);
                        Log.d(TAG, "Now disabling \'" + oi.packageName + "\'");
                    }
                }
            }
        }
    } catch (RemoteException re) {
        re.printStackTrace();
        Log.d(TAG, "RemoteException while trying to contact the Overlay Manager Service!");
    }
}
Also used : OverlayInfo(android.content.om.OverlayInfo) IOverlayManager(android.content.om.IOverlayManager) RemoteCallbackList(android.os.RemoteCallbackList) ArrayList(java.util.ArrayList) List(java.util.List) LocaleList(android.os.LocaleList) RemoteException(android.os.RemoteException)

Example 2 with IOverlayManager

use of android.content.om.IOverlayManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SystemNavigationGestureSettings method updateNavigationBarOverlays.

public static void updateNavigationBarOverlays(Context context) {
    // if gesture nav is already set, force overlay reloading
    if (getCurrentSystemNavigationMode(context) == KEY_SYSTEM_NAV_GESTURAL) {
        final IOverlayManager overlayManager = IOverlayManager.Stub.asInterface(ServiceManager.getService(context.OVERLAY_SERVICE));
        int sensitivity = getBackSensitivity(context, overlayManager);
        setNavBarInteractionMode(overlayManager, BACK_GESTURE_INSET_OVERLAYS[sensitivity], true);
    }
}
Also used : IOverlayManager(android.content.om.IOverlayManager)

Aggregations

IOverlayManager (android.content.om.IOverlayManager)2 OverlayInfo (android.content.om.OverlayInfo)1 LocaleList (android.os.LocaleList)1 RemoteCallbackList (android.os.RemoteCallbackList)1 RemoteException (android.os.RemoteException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1