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

Commit 49d5ca18 authored by Kenny Guy's avatar Kenny Guy Committed by Android (Google) Code Review
Browse files

Merge "Updated calls for LauncherApps renaming." into ub-now-porkchop

parents 2854d256 4da9efa5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public abstract class LauncherAppsCompat {

    public static LauncherAppsCompat getInstance(Context context) {
        synchronized (sInstanceLock) {
            // TODO change this to use api version once L gets an API number.
            // STOPSHIP(kennyguy) change this to use api version once L gets an API number.
            if (sInstance == null) {
                if ("L".equals(Build.VERSION.CODENAME)) {
                    sInstance = new LauncherAppsCompatVL(context);
+7 −7
Original line number Diff line number Diff line
@@ -70,11 +70,11 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat {

    public void startActivityForProfile(ComponentName component, UserHandleCompat user,
            Rect sourceBounds, Bundle opts) {
        mLauncherApps.startActivityForProfile(component, user.getUser(), sourceBounds, opts);
        mLauncherApps.startMainActivity(component, user.getUser(), sourceBounds, opts);
    }

    public void showAppDetailsForProfile(ComponentName component, UserHandleCompat user) {
        mLauncherApps.showAppDetailsForProfile(component, user.getUser(), null, null);
        mLauncherApps.startAppDetailsActivity(component, user.getUser(), null, null);
    }

    public void addOnAppsChangedCallback(LauncherAppsCompat.OnAppsChangedCallbackCompat callback) {
@@ -82,7 +82,7 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat {
        synchronized (mCallbacks) {
            mCallbacks.put(callback, wrappedCallback);
        }
        mLauncherApps.addOnAppsChangedCallback(wrappedCallback);
        mLauncherApps.addCallback(wrappedCallback);
    }

    public void removeOnAppsChangedCallback(
@@ -92,19 +92,19 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat {
            wrappedCallback = mCallbacks.remove(callback);
        }
        if (wrappedCallback != null) {
            mLauncherApps.removeOnAppsChangedCallback(wrappedCallback);
            mLauncherApps.removeCallback(wrappedCallback);
        }
    }

    public boolean isPackageEnabledForProfile(String packageName, UserHandleCompat user) {
        return mLauncherApps.isPackageEnabledForProfile(packageName, user.getUser());
        return mLauncherApps.isPackageEnabled(packageName, user.getUser());
    }

    public boolean isActivityEnabledForProfile(ComponentName component, UserHandleCompat user) {
        return mLauncherApps.isActivityEnabledForProfile(component, user.getUser());
        return mLauncherApps.isActivityEnabled(component, user.getUser());
    }

    private static class WrappedCallback extends LauncherApps.OnAppsChangedCallback {
    private static class WrappedCallback extends LauncherApps.Callback {
        private LauncherAppsCompat.OnAppsChangedCallbackCompat mCallback;

        public WrappedCallback(LauncherAppsCompat.OnAppsChangedCallbackCompat callback) {