use of com.android.launcher3.logging.StatsLogUtils.LogContainerProvider in project Neo-Launcher by NeoApplications.
the class AppLaunchActivity method startUri.
private void startUri(Uri uri) {
try {
ComponentKey dl = AppSearchProvider.uriToComponent(uri, this);
ItemInfo dVar = new AppItemInfoWithIcon(dl);
if (!getPackageManager().isSafeMode() || Utilities.isSystemApp(this, dVar.getIntent())) {
if (dl.user.equals(android.os.Process.myUserHandle())) {
startActivity(dVar.getIntent());
} else {
LauncherAppsCompat.getInstance(this).startActivityForProfile(dl.componentName, dl.user, getIntent().getSourceBounds(), null);
}
View view = new View(this);
view.setTag(dVar);
String predictionRank = uri.getQueryParameter("predictionRank");
new LogContainerProvider(this, TextUtils.isEmpty(predictionRank) ? -1 : Integer.parseInt(predictionRank)).addView(view);
return;
}
Toast.makeText(this, R.string.safemode_shortcut_error, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show();
}
}
use of com.android.launcher3.logging.StatsLogUtils.LogContainerProvider in project Neo-Launcher by NeoApplications.
the class UserEventDispatcher method logDeepShortcutsOpen.
public void logDeepShortcutsOpen(View icon) {
LogContainerProvider provider = StatsLogUtils.getLaunchProviderRecursive(icon);
if (icon == null || !(icon.getTag() instanceof ItemInfo || provider == null)) {
return;
}
ItemInfo info = (ItemInfo) icon.getTag();
LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.LONGPRESS), newItemTarget(info, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
provider.fillInLogContainerData(icon, info, event.srcTarget[0], event.srcTarget[1]);
dispatchUserEvent(event, null);
resetElapsedContainerMillis("deep shortcut open");
}
use of com.android.launcher3.logging.StatsLogUtils.LogContainerProvider in project Neo-Launcher by NeoApplications.
the class UserEventDispatcher method fillInLogContainerData.
/**
* Fills in the container data on the given event if the given view is not null.
*
* @return whether container data was added.
*/
public boolean fillInLogContainerData(LauncherLogProto.LauncherEvent event, @Nullable View v) {
// Fill in grid(x,y), pageIndex of the child and container type of the parent
LogContainerProvider provider = StatsLogUtils.getLaunchProviderRecursive(v);
if (v == null || !(v.getTag() instanceof ItemInfo) || provider == null) {
return false;
}
final ItemInfo itemInfo = (ItemInfo) v.getTag();
final Target target = event.srcTarget[0];
final Target targetParent = event.srcTarget[1];
onFillInLogContainerData(itemInfo, target, targetParent);
provider.fillInLogContainerData(v, itemInfo, target, targetParent);
return true;
}
use of com.android.launcher3.logging.StatsLogUtils.LogContainerProvider in project Neo-Launcher by NeoApplications.
the class UserEventDispatcher method logDragNDrop.
public void logDragNDrop(DropTarget.DragObject dragObj, View dropTargetAsView) {
LauncherEvent event = newLauncherEvent(newTouchAction(Action.Touch.DRAGDROP), newItemTarget(dragObj.originalDragInfo, mInstantAppResolver), newTarget(Target.Type.CONTAINER));
event.destTarget = new Target[] { newItemTarget(dragObj.originalDragInfo, mInstantAppResolver), newDropTarget(dropTargetAsView) };
dragObj.dragSource.fillInLogContainerData(null, dragObj.originalDragInfo, event.srcTarget[0], event.srcTarget[1]);
if (dropTargetAsView instanceof LogContainerProvider) {
((LogContainerProvider) dropTargetAsView).fillInLogContainerData(null, dragObj.dragInfo, event.destTarget[0], event.destTarget[1]);
}
event.actionDurationMillis = SystemClock.uptimeMillis() - mActionDurationMillis;
dispatchUserEvent(event, null);
}
use of com.android.launcher3.logging.StatsLogUtils.LogContainerProvider in project android_packages_apps_Trebuchet by LineageOS.
the class UserEventDispatcher method fillLogContainer.
/**
* Fills in the container data on the given event if the given view is not null.
*
* @return whether container data was added.
*/
public boolean fillLogContainer(@Nullable View v, Target child, @Nullable ArrayList<Target> targets) {
LogContainerProvider firstParent = StatsLogUtils.getLaunchProviderRecursive(v);
if (v == null || !(v.getTag() instanceof ItemInfo) || firstParent == null) {
return false;
}
final ItemInfo itemInfo = (ItemInfo) v.getTag();
firstParent.fillInLogContainerData(itemInfo, child, targets);
return true;
}
Aggregations