summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/touch
diff options
context:
space:
mode:
authorJoey <joey@lineageos.org>2019-01-23 17:49:25 +0100
committerBruno Martins <bgcngm@gmail.com>2020-01-09 14:53:29 +0100
commitaf0d2bfd84bff78d0bdaa65020a2d2aed080055e (patch)
treeb6e6fe447650499531cd4632a9d16ee269c01a6f /src/com/android/launcher3/touch
parent3b44d749f0993c0840b409ee95965443d72e72d6 (diff)
downloadandroid_packages_apps_Trebuchet-af0d2bfd84bff78d0bdaa65020a2d2aed080055e.tar.gz
android_packages_apps_Trebuchet-af0d2bfd84bff78d0bdaa65020a2d2aed080055e.tar.bz2
android_packages_apps_Trebuchet-af0d2bfd84bff78d0bdaa65020a2d2aed080055e.zip
Trebuchet: implement hidden & protected apps
* Trebuchet: implement hidden apps * Trebuchet: Implement protected apps Signed-off-by: Joey <joey@lineageos.org> Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com> Change-Id: I10c35407820373a1d5f84b237ac449398e076dcd
Diffstat (limited to 'src/com/android/launcher3/touch')
-rw-r--r--src/com/android/launcher3/touch/ItemClickHandler.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java
index 03493a538..918b631bc 100644
--- a/src/com/android/launcher3/touch/ItemClickHandler.java
+++ b/src/com/android/launcher3/touch/ItemClickHandler.java
@@ -26,6 +26,7 @@ import static com.android.launcher3.model.AppLaunchTracker.CONTAINER_ALL_APPS;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.LauncherApps;
@@ -55,6 +56,7 @@ import com.android.launcher3.compat.AppWidgetManagerCompat;
import com.android.launcher3.compat.PackageInstallerCompat;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.lineage.trust.db.TrustDatabaseHelper;
import com.android.launcher3.util.PackageManagerHelper;
import com.android.launcher3.views.FloatingIconView;
import com.android.launcher3.widget.PendingAppWidgetHostView;
@@ -267,6 +269,15 @@ public class ItemClickHandler {
// Preload the icon to reduce latency b/w swapping the floating view with the original.
FloatingIconView.fetchIcon(launcher, v, item, true /* isOpening */);
}
- launcher.startActivitySafely(v, intent, item, sourceContainer);
+
+ TrustDatabaseHelper db = TrustDatabaseHelper.getInstance(launcher);
+ ComponentName cn = item.getTargetComponent();
+ boolean isProtected = cn != null && db.isPackageProtected(cn.getPackageName());
+
+ if (isProtected) {
+ launcher.startActivitySafelyAuth(v, intent, item, sourceContainer);
+ } else {
+ launcher.startActivitySafely(v, intent, item, sourceContainer);
+ }
}
}