Snap for 7155219 from 0bd7c9bf46 to sc-v2-release
Change-Id: I58b554a46c80a149f6231ade2315619e82a1b475
This commit is contained in:
commit
d96ca39c21
18 files changed
+101
-85
No files matched your search
@@ -191,6 +191,7 @@ public class RecentTasksList extends TaskStackChangeListener {
|
||||
} else {
|
||||
task = new Task(taskKey);
|
||||
}
|
||||
task.setLastSnapshotData(rawTask);
|
||||
allTasks.add(task);
|
||||
}
|
||||
|
||||
@@ -200,9 +201,7 @@ public class RecentTasksList extends TaskStackChangeListener {
|
||||
private ArrayList<Task> copyOf(ArrayList<Task> tasks) {
|
||||
ArrayList<Task> newTasks = new ArrayList<>();
|
||||
for (int i = 0; i < tasks.size(); i++) {
|
||||
Task t = tasks.get(i);
|
||||
newTasks.add(new Task(t.key, t.colorPrimary, t.colorBackground, t.isDockable,
|
||||
t.isLocked, t.taskDescription, t.topActivity));
|
||||
newTasks.add(new Task(tasks.get(i)));
|
||||
}
|
||||
return newTasks;
|
||||
}
|
||||
|
||||
@@ -646,9 +646,9 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
|
||||
|
||||
public TaskView getTaskView(int taskId) {
|
||||
for (int i = 0; i < getTaskViewCount(); i++) {
|
||||
TaskView tv = getTaskViewAt(i);
|
||||
if (tv.getTask() != null && tv.getTask().key != null && tv.getTask().key.id == taskId) {
|
||||
return tv;
|
||||
TaskView taskView = getTaskViewAt(i);
|
||||
if (taskView.hasTaskId(taskId)) {
|
||||
return taskView;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -808,6 +808,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
|
||||
final Task task = tasks.get(i);
|
||||
final TaskView taskView = (TaskView) getChildAt(pageIndex);
|
||||
taskView.bind(task, mOrientationState);
|
||||
taskView.updateTaskSize(!taskView.hasTaskId(mRunningTaskId));
|
||||
}
|
||||
|
||||
if (mNextPage == INVALID_PAGE) {
|
||||
@@ -942,7 +943,8 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
|
||||
// Force TaskView to update size from thumbnail
|
||||
final int taskCount = getTaskViewCount();
|
||||
for (int i = 0; i < taskCount; i++) {
|
||||
getTaskViewAt(i).updateTaskSize();
|
||||
TaskView taskView = getTaskViewAt(i);
|
||||
taskView.updateTaskSize(!taskView.hasTaskId(mRunningTaskId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1252,6 +1254,7 @@ public abstract class RecentsView<T extends StatefulActivity> extends PagedView
|
||||
// gesture and the task list is loaded and applied
|
||||
mTmpRunningTask = Task.from(new TaskKey(runningTaskInfo), runningTaskInfo, false);
|
||||
taskView.bind(mTmpRunningTask, mOrientationState);
|
||||
taskView.updateTaskSize(false);
|
||||
|
||||
// Measure and layout immediately so that the scroll values is updated instantly
|
||||
// as the user might be quick-switching
|
||||
|
||||
@@ -111,9 +111,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
|
||||
private boolean mOverlayEnabled;
|
||||
private OverviewScreenshotActions mOverviewScreenshotActionsPlugin;
|
||||
|
||||
// TODO(b/179466077): Remove when proper API is ready.
|
||||
private Float mThumbnailRatio = null;
|
||||
|
||||
public TaskThumbnailView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@@ -454,31 +451,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
|
||||
return mThumbnailData.isRealSnapshot;
|
||||
}
|
||||
|
||||
// TODO(b/179466077): Remove when proper API is ready.
|
||||
public float getThumbnailRatio() {
|
||||
// API is ready.
|
||||
if (mThumbnailRatio != null) {
|
||||
return mThumbnailRatio;
|
||||
}
|
||||
|
||||
if (mThumbnailData == null || mThumbnailData.thumbnail == null) {
|
||||
final float[] thumbnailRatios =
|
||||
new float[]{0.8882452f, 1.2834098f, 0.5558415f, 2.15625f};
|
||||
// Use key's hash code to return a deterministic thumbnail ratio.
|
||||
mThumbnailRatio = thumbnailRatios[mTask.key.hashCode() % thumbnailRatios.length];
|
||||
return mThumbnailRatio;
|
||||
}
|
||||
|
||||
float surfaceWidth = mThumbnailData.thumbnail.getWidth() / mThumbnailData.scale;
|
||||
float surfaceHeight = mThumbnailData.thumbnail.getHeight() / mThumbnailData.scale;
|
||||
float availableWidth = surfaceWidth
|
||||
- (mThumbnailData.insets.left + mThumbnailData.insets.right);
|
||||
float availableHeight = surfaceHeight
|
||||
- (mThumbnailData.insets.top + mThumbnailData.insets.bottom);
|
||||
mThumbnailRatio = availableWidth / availableHeight;
|
||||
return mThumbnailRatio;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility class to position the thumbnail in the TaskView
|
||||
*/
|
||||
|
||||
@@ -48,6 +48,7 @@ import android.app.ActivityOptions;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -449,7 +450,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
cancelPendingLoadTasks();
|
||||
mTask = task;
|
||||
mSnapshotView.bind(task);
|
||||
updateTaskSize();
|
||||
setOrientationState(orientedState);
|
||||
}
|
||||
|
||||
@@ -457,6 +457,10 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
return mTask;
|
||||
}
|
||||
|
||||
public boolean hasTaskId(int taskId) {
|
||||
return mTask != null && mTask.key != null && mTask.key.id == taskId;
|
||||
}
|
||||
|
||||
public TaskThumbnailView getThumbnail() {
|
||||
return mSnapshotView;
|
||||
}
|
||||
@@ -1077,9 +1081,11 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
previewPositionHelper);
|
||||
}
|
||||
|
||||
void updateTaskSize() {
|
||||
void updateTaskSize(boolean variableWidth) {
|
||||
ViewGroup.LayoutParams params = getLayoutParams();
|
||||
if (mActivity.getDeviceProfile().isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get()) {
|
||||
float thumbnailRatio = mTask != null ? mTask.getVisibleThumbnailRatio() : 0f;
|
||||
if (variableWidth && mActivity.getDeviceProfile().isTablet
|
||||
&& FeatureFlags.ENABLE_OVERVIEW_GRID.get() && thumbnailRatio != 0f) {
|
||||
final int thumbnailPadding = (int) getResources().getDimension(
|
||||
R.dimen.task_thumbnail_top_margin);
|
||||
|
||||
@@ -1087,7 +1093,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
int taskWidth = lastComputedTaskSize.width();
|
||||
int taskHeight = lastComputedTaskSize.height();
|
||||
int boxLength = Math.max(taskWidth, taskHeight);
|
||||
float thumbnailRatio = mSnapshotView.getThumbnailRatio();
|
||||
|
||||
int expectedWidth;
|
||||
int expectedHeight;
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingTop="16dp"
|
||||
launcher:pageIndicator="@+id/folder_page_indicator" />
|
||||
|
||||
|
||||
+11
-11
@@ -17,17 +17,17 @@
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<color name="popup_color_primary_light">@android:color/system_main_50</color>
|
||||
<color name="popup_color_secondary_light">@android:color/system_main_100</color>
|
||||
<color name="popup_color_tertiary_light">@android:color/system_main_300</color>
|
||||
<color name="popup_color_primary_dark">@android:color/system_main_800</color>
|
||||
<color name="popup_color_secondary_dark">@android:color/system_main_900</color>
|
||||
<color name="popup_color_tertiary_dark">@android:color/system_main_700</color>
|
||||
<color name="popup_color_primary_light">@android:color/system_primary_50</color>
|
||||
<color name="popup_color_secondary_light">@android:color/system_primary_100</color>
|
||||
<color name="popup_color_tertiary_light">@android:color/system_primary_300</color>
|
||||
<color name="popup_color_primary_dark">@android:color/system_primary_800</color>
|
||||
<color name="popup_color_secondary_dark">@android:color/system_primary_900</color>
|
||||
<color name="popup_color_tertiary_dark">@android:color/system_primary_700</color>
|
||||
|
||||
<color name="workspace_text_color_light">@android:color/system_main_50</color>
|
||||
<color name="workspace_text_color_dark">@android:color/system_main_900</color>
|
||||
<color name="workspace_text_color_light">@android:color/system_primary_50</color>
|
||||
<color name="workspace_text_color_dark">@android:color/system_primary_900</color>
|
||||
|
||||
<color name="text_color_primary_dark">@android:color/system_main_50</color>
|
||||
<color name="text_color_secondary_dark">@android:color/system_main_200</color>
|
||||
<color name="text_color_tertiary_dark">@android:color/system_main_400</color>
|
||||
<color name="text_color_primary_dark">@android:color/system_primary_50</color>
|
||||
<color name="text_color_secondary_dark">@android:color/system_primary_200</color>
|
||||
<color name="text_color_tertiary_dark">@android:color/system_primary_400</color>
|
||||
</resources>
|
||||
@@ -149,9 +149,9 @@
|
||||
<dimen name="folder_cell_x_padding">9dp</dimen>
|
||||
<dimen name="folder_cell_y_padding">6dp</dimen>
|
||||
<dimen name="folder_child_text_size">13sp</dimen>
|
||||
<dimen name="folder_label_padding_top">4dp</dimen>
|
||||
<dimen name="folder_label_padding_top">12dp</dimen>
|
||||
<dimen name="folder_label_padding_bottom">12dp</dimen>
|
||||
<dimen name="folder_label_text_size">14sp</dimen>
|
||||
<dimen name="folder_label_text_size">16sp</dimen>
|
||||
|
||||
<!-- Sizes for managed profile badges -->
|
||||
<dimen name="profile_badge_size">24dp</dimen>
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.android.launcher3;
|
||||
import static android.animation.ValueAnimator.areAnimatorsEnabled;
|
||||
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL_1_5;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_FOUR_COLUMNS;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
@@ -599,7 +600,9 @@ public class CellLayout extends ViewGroup {
|
||||
if (child instanceof BubbleTextView) {
|
||||
BubbleTextView bubbleChild = (BubbleTextView) child;
|
||||
bubbleChild.setTextVisibility(mContainerType != HOTSEAT);
|
||||
bubbleChild.setCenterVertically(mContainerType != HOTSEAT);
|
||||
if (ENABLE_FOUR_COLUMNS.get()) {
|
||||
bubbleChild.setCenterVertically(mContainerType != HOTSEAT);
|
||||
}
|
||||
}
|
||||
|
||||
child.setScaleX(mChildScale);
|
||||
|
||||
@@ -648,8 +648,13 @@ public class DeviceProfile {
|
||||
public boolean updateIsSeascape(Context context) {
|
||||
if (isVerticalBarLayout()) {
|
||||
// Check an up-to-date info.
|
||||
boolean isSeascape = DisplayController.getDefaultDisplay(context)
|
||||
.createInfoForContext(context).rotation == Surface.ROTATION_270;
|
||||
DisplayController.Info displayInfo = DisplayController.getDefaultDisplay(context)
|
||||
.createInfoForContext(context);
|
||||
if (displayInfo == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean isSeascape = displayInfo.rotation == Surface.ROTATION_270;
|
||||
if (mIsSeascape != isSeascape) {
|
||||
mIsSeascape = isSeascape;
|
||||
return true;
|
||||
|
||||
@@ -605,7 +605,6 @@ public final class Utilities {
|
||||
outObj[0] = activityInfo;
|
||||
return activityInfo.getFullResIcon(appState.getIconCache());
|
||||
}
|
||||
if (info.getIntent() == null || info.getIntent().getPackage() == null) return null;
|
||||
List<ShortcutInfo> si = ShortcutKey.fromItemInfo(info)
|
||||
.buildRequest(launcher)
|
||||
.query(ShortcutRequest.ALL);
|
||||
|
||||
@@ -22,7 +22,6 @@ import static com.android.launcher3.model.data.AppInfo.EMPTY_ARRAY;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.LauncherActivityInfo;
|
||||
import android.content.pm.LauncherApps;
|
||||
import android.os.LocaleList;
|
||||
@@ -145,10 +144,9 @@ public class AllAppsList {
|
||||
}
|
||||
|
||||
public void addPromiseApp(Context context, PackageInstallInfo installInfo) {
|
||||
ApplicationInfo applicationInfo = new PackageManagerHelper(context)
|
||||
.getApplicationInfo(installInfo.packageName, installInfo.user, 0);
|
||||
// only if not yet installed
|
||||
if (applicationInfo == null) {
|
||||
if (!new PackageManagerHelper(context)
|
||||
.isAppInstalled(installInfo.packageName, installInfo.user)) {
|
||||
AppInfo info = new AppInfo(installInfo);
|
||||
mIconCache.getTitleAndIcon(info, info.usingLowResIcon());
|
||||
info.sectionName = mIndex.computeSectionName(info.title);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
@@ -66,8 +66,8 @@ public class PackageIncrementalDownloadUpdatedTask extends BaseModelUpdateTask {
|
||||
final ArrayList<WorkspaceItemInfo> updatedWorkspaceItems = new ArrayList<>();
|
||||
synchronized (dataModel) {
|
||||
dataModel.forAllWorkspaceItemInfos(mUser, si -> {
|
||||
ComponentName cn = si.getTargetComponent();
|
||||
if ((cn != null) && cn.getPackageName().equals(mPackageName)) {
|
||||
Intent intent = si.getIntent();
|
||||
if ((intent != null) && mPackageName.equals(intent.getPackage())) {
|
||||
si.runtimeStatusFlags &= ~ItemInfoWithIcon.FLAG_INSTALL_SESSION_ACTIVE;
|
||||
si.setProgressLevel(downloadInfo);
|
||||
updatedWorkspaceItems.add(si);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
@@ -72,9 +72,9 @@ public class PackageInstallStateChangedTask extends BaseModelUpdateTask {
|
||||
synchronized (dataModel) {
|
||||
final HashSet<ItemInfo> updates = new HashSet<>();
|
||||
dataModel.forAllWorkspaceItemInfos(mInstallInfo.user, si -> {
|
||||
ComponentName cn = si.getTargetComponent();
|
||||
if (si.hasPromiseIconUi() && (cn != null)
|
||||
&& cn.getPackageName().equals(mInstallInfo.packageName)) {
|
||||
Intent intent = si.getIntent();
|
||||
if (si.hasPromiseIconUi() && (intent != null)
|
||||
&& mInstallInfo.packageName.equals(intent.getPackage())) {
|
||||
int installProgress = mInstallInfo.progress;
|
||||
|
||||
si.setProgressLevel(installProgress, PackageInstallInfo.STATUS_INSTALLING);
|
||||
|
||||
@@ -30,6 +30,7 @@ import android.os.UserManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.LauncherSettings;
|
||||
import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.icons.BitmapInfo;
|
||||
@@ -228,7 +229,8 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
isTargetValid = context.getSystemService(LauncherApps.class)
|
||||
.isActivityEnabled(cn, mUser);
|
||||
}
|
||||
if (si.hasStatusFlag(FLAG_RESTORED_ICON | FLAG_AUTOINSTALL_ICON)) {
|
||||
if (!isTargetValid && si.hasStatusFlag(
|
||||
FLAG_RESTORED_ICON | FLAG_AUTOINSTALL_ICON)) {
|
||||
if (updateWorkspaceItemIntent(context, si, packageName)) {
|
||||
infoUpdated = true;
|
||||
} else if (si.hasPromiseIconUi()) {
|
||||
@@ -250,8 +252,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewApkAvailable
|
||||
&& si.itemType == Favorites.ITEM_TYPE_APPLICATION) {
|
||||
if (isNewApkAvailable) {
|
||||
List<LauncherActivityInfo> activities = activitiesLists.get(
|
||||
packageName);
|
||||
si.setProgressLevel(
|
||||
@@ -260,8 +261,10 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
: PackageManagerHelper.getLoadingProgress(
|
||||
activities.get(0)),
|
||||
PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
|
||||
iconCache.getTitleAndIcon(si, si.usingLowResIcon());
|
||||
infoUpdated = true;
|
||||
if (si.itemType == Favorites.ITEM_TYPE_APPLICATION) {
|
||||
iconCache.getTitleAndIcon(si, si.usingLowResIcon());
|
||||
infoUpdated = true;
|
||||
}
|
||||
}
|
||||
|
||||
int oldRuntimeFlags = si.runtimeStatusFlags;
|
||||
@@ -353,6 +356,11 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
*/
|
||||
private boolean updateWorkspaceItemIntent(Context context,
|
||||
WorkspaceItemInfo si, String packageName) {
|
||||
if (si.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
|
||||
// Do not update intent for deep shortcuts as they contain additional information
|
||||
// about the shortcut.
|
||||
return false;
|
||||
}
|
||||
// Try to find the best match activity.
|
||||
Intent intent = new PackageManagerHelper(context).getAppLaunchIntent(packageName, mUser);
|
||||
if (intent != null) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.shortcuts.ShortcutKey;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
import com.android.launcher3.util.PackageManagerHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@@ -66,6 +67,14 @@ public class ShortcutsChangedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
|
||||
if (!matchingWorkspaceItems.isEmpty()) {
|
||||
if (mShortcuts.isEmpty()) {
|
||||
// Verify that the app is indeed installed.
|
||||
if (!new PackageManagerHelper(app.getContext())
|
||||
.isAppInstalled(mPackageName, mUser)) {
|
||||
// App is not installed, ignoring package events
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Update the workspace to reflect the changes to updated shortcuts residing on it.
|
||||
List<String> allLauncherKnownIds = matchingWorkspaceItems.stream()
|
||||
.map(WorkspaceItemInfo::getDeepShortcutId)
|
||||
|
||||
@@ -217,8 +217,8 @@ public class InstallSessionHelper {
|
||||
&& sessionInfo.getAppIcon() != null
|
||||
&& !TextUtils.isEmpty(sessionInfo.getAppLabel())
|
||||
&& !promiseIconAddedForId(sessionInfo.getSessionId())
|
||||
&& new PackageManagerHelper(mAppContext).getApplicationInfo(
|
||||
sessionInfo.getAppPackageName(), getUserHandle(sessionInfo), 0) == null) {
|
||||
&& !new PackageManagerHelper(mAppContext).isAppInstalled(
|
||||
sessionInfo.getAppPackageName(), getUserHandle(sessionInfo))) {
|
||||
ItemInstallQueue.INSTANCE.get(mAppContext)
|
||||
.queueItem(sessionInfo.getAppPackageName(), getUserHandle(sessionInfo));
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.view.Display;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.launcher3.Utilities;
|
||||
@@ -182,20 +183,26 @@ public class DisplayController implements DisplayListener {
|
||||
}
|
||||
|
||||
/** Creates and up-to-date DisplayController.Info for the given context. */
|
||||
@Nullable
|
||||
public Info createInfoForContext(Context context) {
|
||||
Display display = Utilities.ATLEAST_R
|
||||
? context.getDisplay()
|
||||
: context
|
||||
.getSystemService(DisplayManager.class)
|
||||
.getDisplay(mId);
|
||||
return display == null
|
||||
? new Info(context)
|
||||
: new Info(context, display);
|
||||
Display display = Utilities.ATLEAST_R ? context.getDisplay() : null;
|
||||
if (display == null) {
|
||||
display = context.getSystemService(DisplayManager.class).getDisplay(mId);
|
||||
}
|
||||
if (display == null) {
|
||||
return null;
|
||||
}
|
||||
// Refresh the Context the prevent stale DisplayMetrics.
|
||||
Context displayContext = context.getApplicationContext().createDisplayContext(display);
|
||||
return new Info(displayContext, display);
|
||||
}
|
||||
|
||||
protected void handleOnChange() {
|
||||
Info oldInfo = mInfo;
|
||||
Info newInfo = createInfoForContext(mDisplayContext);
|
||||
if (newInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int change = 0;
|
||||
if (newInfo.hasDifferentSize(oldInfo)) {
|
||||
|
||||
@@ -91,6 +91,14 @@ public class PackageManagerHelper {
|
||||
return info != null && isAppSuspended(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the target app is installed for a given user
|
||||
*/
|
||||
public boolean isAppInstalled(String packageName, UserHandle user) {
|
||||
ApplicationInfo info = getApplicationInfo(packageName, user, 0);
|
||||
return info != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the application info for the provided package or null
|
||||
*/
|
||||
@@ -105,7 +113,7 @@ public class PackageManagerHelper {
|
||||
}
|
||||
|
||||
public boolean isSafeMode() {
|
||||
return mContext.getPackageManager().isSafeMode();
|
||||
return mPm.isSafeMode();
|
||||
}
|
||||
|
||||
public Intent getAppLaunchIntent(String pkg, UserHandle user) {
|
||||
|
||||
Reference in new issue
Block a user