Loading src/com/android/launcher3/compat/LauncherAppsCompat.java +6 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.LauncherActivityInfo; import android.content.pm.PackageInstaller; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.Bundle; Loading Loading @@ -56,7 +57,9 @@ public abstract class LauncherAppsCompat { public static LauncherAppsCompat getInstance(Context context) { synchronized (sInstanceLock) { if (sInstance == null) { if (Utilities.ATLEAST_OREO) { if (Utilities.ATLEAST_Q) { sInstance = new LauncherAppsCompatVQ(context.getApplicationContext()); } else if (Utilities.ATLEAST_OREO) { sInstance = new LauncherAppsCompatVO(context.getApplicationContext()); } else { sInstance = new LauncherAppsCompatVL(context.getApplicationContext()); Loading @@ -83,4 +86,6 @@ public abstract class LauncherAppsCompat { UserHandle user); public abstract List<ShortcutConfigActivityInfo> getCustomShortcutActivityList( @Nullable PackageUserKey packageUser); public abstract List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions(); } src/com/android/launcher3/compat/LauncherAppsCompatVL.java +6 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.LauncherActivityInfo; import android.content.pm.LauncherApps; import android.content.pm.PackageInstaller; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ShortcutInfo; Loading Loading @@ -199,5 +200,10 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat { } return result; } @Override public List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions() { return mContext.getPackageManager().getPackageInstaller().getAllSessions(); } } src/com/android/launcher3/compat/LauncherAppsCompatVQ.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.compat; import android.annotation.TargetApi; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInstaller; import java.util.List; @TargetApi(29) public class LauncherAppsCompatVQ extends LauncherAppsCompatVO { LauncherAppsCompatVQ(Context context) { super(context); } public List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions() { return mLauncherApps.getAllPackageInstallerSessions(); } } src/com/android/launcher3/compat/PackageInstallerCompatVL.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.UserHandle; import android.text.TextUtils; import android.util.SparseArray; import com.android.launcher3.Utilities; import com.android.launcher3.icons.IconCache; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; Loading @@ -49,6 +50,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { private final Handler mWorker; private final Context mAppContext; private final HashMap<String,Boolean> mSessionVerifiedMap = new HashMap<>(); private final LauncherAppsCompat mLauncherApps; PackageInstallerCompatVL(Context context) { mAppContext = context.getApplicationContext(); Loading @@ -56,6 +58,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { mCache = LauncherAppState.getInstance(context).getIconCache(); mWorker = new Handler(LauncherModel.getWorkerLooper()); mInstaller.registerSessionCallback(mCallback, mWorker); mLauncherApps = LauncherAppsCompat.getInstance(context); } @Override Loading Loading @@ -171,7 +174,9 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { @Override public List<SessionInfo> getAllVerifiedSessions() { List<SessionInfo> list = new ArrayList<>(mInstaller.getAllSessions()); List<SessionInfo> list = new ArrayList<>(Utilities.ATLEAST_Q ? mLauncherApps.getAllPackageInstallerSessions() : mInstaller.getAllSessions()); Iterator<SessionInfo> it = list.iterator(); while (it.hasNext()) { if (verify(it.next()) == null) { Loading Loading
src/com/android/launcher3/compat/LauncherAppsCompat.java +6 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.LauncherActivityInfo; import android.content.pm.PackageInstaller; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.Bundle; Loading Loading @@ -56,7 +57,9 @@ public abstract class LauncherAppsCompat { public static LauncherAppsCompat getInstance(Context context) { synchronized (sInstanceLock) { if (sInstance == null) { if (Utilities.ATLEAST_OREO) { if (Utilities.ATLEAST_Q) { sInstance = new LauncherAppsCompatVQ(context.getApplicationContext()); } else if (Utilities.ATLEAST_OREO) { sInstance = new LauncherAppsCompatVO(context.getApplicationContext()); } else { sInstance = new LauncherAppsCompatVL(context.getApplicationContext()); Loading @@ -83,4 +86,6 @@ public abstract class LauncherAppsCompat { UserHandle user); public abstract List<ShortcutConfigActivityInfo> getCustomShortcutActivityList( @Nullable PackageUserKey packageUser); public abstract List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions(); }
src/com/android/launcher3/compat/LauncherAppsCompatVL.java +6 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.LauncherActivityInfo; import android.content.pm.LauncherApps; import android.content.pm.PackageInstaller; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ShortcutInfo; Loading Loading @@ -199,5 +200,10 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat { } return result; } @Override public List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions() { return mContext.getPackageManager().getPackageInstaller().getAllSessions(); } }
src/com/android/launcher3/compat/LauncherAppsCompatVQ.java 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.compat; import android.annotation.TargetApi; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInstaller; import java.util.List; @TargetApi(29) public class LauncherAppsCompatVQ extends LauncherAppsCompatVO { LauncherAppsCompatVQ(Context context) { super(context); } public List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions() { return mLauncherApps.getAllPackageInstallerSessions(); } }
src/com/android/launcher3/compat/PackageInstallerCompatVL.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.os.UserHandle; import android.text.TextUtils; import android.util.SparseArray; import com.android.launcher3.Utilities; import com.android.launcher3.icons.IconCache; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; Loading @@ -49,6 +50,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { private final Handler mWorker; private final Context mAppContext; private final HashMap<String,Boolean> mSessionVerifiedMap = new HashMap<>(); private final LauncherAppsCompat mLauncherApps; PackageInstallerCompatVL(Context context) { mAppContext = context.getApplicationContext(); Loading @@ -56,6 +58,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { mCache = LauncherAppState.getInstance(context).getIconCache(); mWorker = new Handler(LauncherModel.getWorkerLooper()); mInstaller.registerSessionCallback(mCallback, mWorker); mLauncherApps = LauncherAppsCompat.getInstance(context); } @Override Loading Loading @@ -171,7 +174,9 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat { @Override public List<SessionInfo> getAllVerifiedSessions() { List<SessionInfo> list = new ArrayList<>(mInstaller.getAllSessions()); List<SessionInfo> list = new ArrayList<>(Utilities.ATLEAST_Q ? mLauncherApps.getAllPackageInstallerSessions() : mInstaller.getAllSessions()); Iterator<SessionInfo> it = list.iterator(); while (it.hasNext()) { if (verify(it.next()) == null) { Loading