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

Commit e1b7ca56 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Moving various application into related methods to a separate class" into main

parents 527e9653 28d6bbd6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -131,11 +131,11 @@ import com.android.launcher3.touch.ItemClickHandler;
import com.android.launcher3.touch.ItemClickHandler.ItemClickProxy;
import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.ApiWrapper;
import com.android.launcher3.util.ApplicationInfoWrapper;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.Executors;
import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.RunnableList;
import com.android.launcher3.util.SettingsCache;
import com.android.launcher3.util.SplitConfigurationOptions.SplitSelectSource;
@@ -1233,7 +1233,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
                    Intent intent = new Intent(info.getIntent())
                            .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    try {
                        if (mIsSafeModeEnabled && !PackageManagerHelper.isSystemApp(this, intent)) {
                        if (mIsSafeModeEnabled
                                && !new ApplicationInfoWrapper(this, intent).isSystem()) {
                            Toast.makeText(this, R.string.safemode_shortcut_error,
                                    Toast.LENGTH_SHORT).show();
                        } else if (info.isPromise()) {
+3 −3
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ import android.view.RemoteAnimationTarget;
import androidx.annotation.Nullable;

import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.ApplicationInfoWrapper;
import com.android.launcher3.util.ComponentKey;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.TraceHelper;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -70,8 +70,8 @@ public final class TaskUtils {
            return "";
        }
        UserHandle user = UserHandle.of(userId);
        ApplicationInfo applicationInfo = PackageManagerHelper.INSTANCE.get(context)
                .getApplicationInfo(packageName, user, 0);
        ApplicationInfo applicationInfo =
                new ApplicationInfoWrapper(context, packageName, user).getInfo();
        if (applicationInfo == null) {
            Log.e(TAG, "Failed to get title for userId=" + userId + ", packageName=" + packageName);
            return "";
+3 −2
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ import com.android.launcher3.pm.InstallSessionTracker;
import com.android.launcher3.pm.PackageInstallInfo;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.shortcuts.ShortcutRequest;
import com.android.launcher3.util.ApplicationInfoWrapper;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.PackageManagerHelper;
@@ -446,8 +447,8 @@ public class LauncherModel implements InstallSessionTracker.Callback {
            IconCache iconCache = mApp.getIconCache();
            final IntSet removedIds = new IntSet();
            HashSet<WorkspaceItemInfo> archivedWorkspaceItemsToCacheRefresh = new HashSet<>();
            boolean isAppArchived = PackageManagerHelper.INSTANCE.get(mApp.getContext())
                    .isAppArchivedForUser(packageName, user);
            boolean isAppArchived =
                    new ApplicationInfoWrapper(mApp.getContext(), packageName, user).isArchived();
            synchronized (dataModel) {
                if (isAppArchived) {
                    // Remove package icon cache entry for archived app in case of a session
+3 −5
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.LauncherActivityInfo;
import android.content.pm.LauncherApps;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.UserHandle;
@@ -44,7 +43,7 @@ import com.android.launcher3.logging.StatsLogManager.StatsLogger;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.ItemInfoWithIcon;
import com.android.launcher3.pm.UserCache;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.ApplicationInfoWrapper;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;

import java.net.URISyntaxException;
@@ -342,9 +341,8 @@ public class SecondaryDropTarget extends ButtonDropTarget implements OnAlarmList
        }

        public void onLauncherResume() {
            // We use MATCH_UNINSTALLED_PACKAGES as the app can be on SD card as well.
            if (PackageManagerHelper.INSTANCE.get(mContext).getApplicationInfo(mPackageName,
                    mDragObject.dragInfo.user, PackageManager.MATCH_UNINSTALLED_PACKAGES) == null) {
            if (new ApplicationInfoWrapper(mContext, mPackageName, mDragObject.dragInfo.user)
                    .getInfo() == null) {
                mDragObject.dragSource = mOriginal;
                mOriginal.onDropCompleted(SecondaryDropTarget.this, mDragObject, true);
                mStatsLogManager.logger().withInstanceId(mDragObject.logInstanceId)
+3 −3
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.PackageItemInfo;
import com.android.launcher3.pm.PinRequestHelper;
import com.android.launcher3.util.ApiWrapper;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.util.ApplicationInfoWrapper;
import com.android.launcher3.util.SystemUiController;
import com.android.launcher3.views.AbstractSlideInView;
import com.android.launcher3.views.BaseDragLayer;
@@ -164,8 +164,8 @@ public class AddItemActivity extends BaseActivity
            finish();
            return;
        }
        ApplicationInfo info = PackageManagerHelper.INSTANCE.get(this)
                .getApplicationInfo(targetApp.packageName, targetApp.user, 0);
        ApplicationInfo info = new ApplicationInfoWrapper(
                this, targetApp.packageName, targetApp.user).getInfo();
        if (info == null) {
            finish();
            return;
Loading