当前位置: 首页>>代码示例>>Java>>正文


Java LauncherActivityInfo.getUser方法代码示例

本文整理汇总了Java中android.content.pm.LauncherActivityInfo.getUser方法的典型用法代码示例。如果您正苦于以下问题:Java LauncherActivityInfo.getUser方法的具体用法?Java LauncherActivityInfo.getUser怎么用?Java LauncherActivityInfo.getUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.pm.LauncherActivityInfo的用法示例。


在下文中一共展示了LauncherActivityInfo.getUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addIconToDBAndMemCache

import android.content.pm.LauncherActivityInfo; //导入方法依赖的package包/类
/**
 * Adds an entry into the DB and the in-memory cache.
 * @param replaceExisting if true, it will recreate the bitmap even if it already exists in
 *                        the memory. This is useful then the previous bitmap was created using
 *                        old data.
 */
@Thunk private synchronized void addIconToDBAndMemCache(LauncherActivityInfo app,
        PackageInfo info, long userSerial, boolean replaceExisting) {
    final ComponentKey key = new ComponentKey(app.getComponentName(), app.getUser());
    CacheEntry entry = null;
    if (!replaceExisting) {
        entry = mCache.get(key);
        // We can't reuse the entry if the high-res icon is not present.
        if (entry == null || entry.isLowResIcon || entry.icon == null) {
            entry = null;
        }
    }
    if (entry == null) {
        entry = new CacheEntry();
        entry.icon = LauncherIcons.createBadgedIconBitmap(getFullResIcon(app), app.getUser(),
                mContext,  app.getApplicationInfo().targetSdkVersion);
    }
    entry.title = app.getLabel();
    entry.contentDescription = mUserManager.getBadgedLabelForUser(entry.title, app.getUser());
    mCache.put(key, entry);

    Bitmap lowResIcon = generateLowResIcon(entry.icon, mActivityBgColor);
    ContentValues values = newContentValues(entry.icon, lowResIcon, entry.title.toString(),
            app.getApplicationInfo().packageName);
    addIconToDB(values, app.getComponentName(), info, userSerial);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:32,代码来源:IconCache.java

示例2: addCustomInfoToDataBase

import android.content.pm.LauncherActivityInfo; //导入方法依赖的package包/类
public void addCustomInfoToDataBase(Drawable icon, ItemInfo info, CharSequence title) {
    LauncherActivityInfo app = mLauncherApps.resolveActivity(info.getIntent(), info.user);
    final ComponentKey key = new ComponentKey(app.getComponentName(), app.getUser());
    CacheEntry entry = mCache.get(key);
    PackageInfo packageInfo = null;
    try {
        packageInfo = mPackageManager.getPackageInfo(
                app.getComponentName().getPackageName(), 0);
    } catch (NameNotFoundException e) {
        e.printStackTrace();
    }
    // We can't reuse the entry if the high-res icon is not present.
    if (entry == null || entry.isLowResIcon || entry.icon == null) {
        entry = new CacheEntry();
    }
    entry.icon = LauncherIcons.createIconBitmap(icon, mContext);

    entry.title = title != null ? title : app.getLabel();

    entry.contentDescription = mUserManager.getBadgedLabelForUser(entry.title, app.getUser());
    mCache.put(key, entry);

    Bitmap lowResIcon = generateLowResIcon(entry.icon, mActivityBgColor);
    ContentValues values = newContentValues(entry.icon, lowResIcon, entry.title.toString(),
            app.getApplicationInfo().packageName);
    if (packageInfo != null) {
        addIconToDB(values, app.getComponentName(), packageInfo,
                mUserManager.getSerialNumberForUser(app.getUser()));
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:31,代码来源:IconCache.java

示例3: PendingInstallShortcutInfo

import android.content.pm.LauncherActivityInfo; //导入方法依赖的package包/类
/**
 * Initializes a PendingInstallShortcutInfo to represent a launcher target.
 */
PendingInstallShortcutInfo(LauncherActivityInfo info, Context context) {
    activityInfo = info;
    shortcutInfo = null;
    providerInfo = null;

    data = null;
    user = info.getUser();
    mContext = context;

    launchIntent = AppInfo.makeLaunchIntent(info);
    label = info.getLabel().toString();
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:16,代码来源:InstallShortcutReceiver.java

示例4: ShortcutConfigActivityInfoVO

import android.content.pm.LauncherActivityInfo; //导入方法依赖的package包/类
ShortcutConfigActivityInfoVO(LauncherActivityInfo info) {
    super(info.getComponentName(), info.getUser());
    mInfo = info;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:5,代码来源:ShortcutConfigActivityInfo.java

示例5: getCacheEntry

import android.content.pm.LauncherActivityInfo; //导入方法依赖的package包/类
public CacheEntry getCacheEntry(LauncherActivityInfo app) {
    final ComponentKey key = new ComponentKey(app.getComponentName(), app.getUser());
    return mCache.get(key);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:5,代码来源:IconCache.java


注:本文中的android.content.pm.LauncherActivityInfo.getUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。