• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SessionInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



SessionInfo类属于android.content.pm.PackageInstaller包,在下文中一共展示了SessionInfo类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: PackageInstallerImpl

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
public PackageInstallerImpl(Context paramContext)
{
  this.mContext = paramContext;
  this.mPackageInstaller = this.mContext.getPackageManager().getPackageInstaller();
  this.mSessionInfoMap = new HashMap();
  Iterator localIterator = this.mPackageInstaller.getMySessions().iterator();
  while (localIterator.hasNext())
  {
    PackageInstaller.SessionInfo localSessionInfo1 = (PackageInstaller.SessionInfo)localIterator.next();
    String str = localSessionInfo1.getAppPackageName();
    PackageInstaller.SessionInfo localSessionInfo2 = (PackageInstaller.SessionInfo)this.mSessionInfoMap.put(str, localSessionInfo1);
    if (localSessionInfo2 != null)
    {
      Object[] arrayOfObject = new Object[3];
      arrayOfObject[0] = str;
      arrayOfObject[1] = Integer.valueOf(localSessionInfo2.getSessionId());
      arrayOfObject[2] = Integer.valueOf(localSessionInfo1.getSessionId());
      FinskyLog.w("Multiple sessions for %s found. Removing %d & keeping %d.", arrayOfObject);
    }
  }
  this.mOpenSessionMap = new HashMap();
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:23,代码来源:PackageInstallerImpl.java


示例2: a

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
private static boolean a(Context paramContext, String paramString)
{
  if (Build.VERSION.SDK_INT >= 21) {}
  for (int i = 1; i != 0; i = 0)
  {
    Iterator localIterator = paramContext.getPackageManager().getPackageInstaller().getAllSessions().iterator();
    do
    {
      if (!localIterator.hasNext()) {
        break;
      }
    } while (!paramString.equals(((PackageInstaller.SessionInfo)localIterator.next()).getAppPackageName()));
    return true;
  }
  PackageManager localPackageManager = paramContext.getPackageManager();
  try
  {
    boolean bool = localPackageManager.getApplicationInfo(paramString, 8192).enabled;
    if (bool) {
      return true;
    }
  }
  catch (PackageManager.NameNotFoundException localNameNotFoundException) {}
  return false;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:26,代码来源:eer.java


示例3: PackageInstallerCompatVL

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
PackageInstallerCompatVL(Context context) {
    mInstaller = context.getPackageManager().getPackageInstaller();
    LauncherAppState.setApplicationContext(context.getApplicationContext());
    mCache = LauncherAppState.getInstance().getIconCache();
    mWorker = new Handler();

    mResumed = false;
    mBound = false;

    mInstaller.registerSessionCallback(mCallback, mWorker);

    // On start, send updates for all active sessions
    mWorker.post(new Runnable() {

        @Override
        public void run() {
            for (SessionInfo info : mInstaller.getAllSessions()) {
                mPendingReplays.append(info.getSessionId(), info);
            }
        }
    });
}
 
开发者ID:AndroidDeveloperLB,项目名称:LB-Launcher,代码行数:23,代码来源:PackageInstallerCompatVL.java


示例4: updateAndGetActiveSessionCache

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Override
public HashMap<String, Integer> updateAndGetActiveSessionCache() {
    HashMap<String, Integer> activePackages = new HashMap<>();
    UserHandle user = Process.myUserHandle();
    for (SessionInfo info : mInstaller.getAllSessions()) {
        addSessionInfoToCache(info, user);
        if (info.getAppPackageName() != null) {
            activePackages.put(info.getAppPackageName(), (int) (info.getProgress() * 100));
            mActiveSessions.put(info.getSessionId(), info.getAppPackageName());
        }
    }
    return activePackages;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:14,代码来源:PackageInstallerCompatVL.java


示例5: addSessionInfoToCache

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Thunk private void addSessionInfoToCache(SessionInfo info, UserHandle user) {
    String packageName = info.getAppPackageName();
    if (packageName != null) {
        mCache.cachePackageInstallInfo(packageName, user, info.getAppIcon(),
                info.getAppLabel());
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:8,代码来源:PackageInstallerCompatVL.java


示例6: onProgressChanged

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Override
public void onProgressChanged(int sessionId, float progress) {
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if (session != null && session.getAppPackageName() != null) {
        sendUpdate(new PackageInstallInfo(session.getAppPackageName(),
                STATUS_INSTALLING,
                (int) (session.getProgress() * 100)));
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:10,代码来源:PackageInstallerCompatVL.java


示例7: pushSessionDisplayToLauncher

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
private void pushSessionDisplayToLauncher(int sessionId) {
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if (session != null && session.getAppPackageName() != null) {
        addSessionInfoToCache(session, Process.myUserHandle());
        LauncherAppState app = LauncherAppState.getInstanceNoCreate();

        if (app != null) {
            app.getModel().updateSessionDisplayInfo(session.getAppPackageName());
        }
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:12,代码来源:PackageInstallerCompatVL.java


示例8: updateAndGetActiveSessionCache

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Override
public HashMap<String, Integer> updateAndGetActiveSessionCache() {
    HashMap<String, Integer> activePackages = new HashMap<>();
    UserHandleCompat user = UserHandleCompat.myUserHandle();
    for (SessionInfo info : mInstaller.getAllSessions()) {
        addSessionInfoToCahce(info, user);
        if (info.getAppPackageName() != null) {
            activePackages.put(info.getAppPackageName(), (int) (info.getProgress() * 100));
            mActiveSessions.put(info.getSessionId(), info.getAppPackageName());
        }
    }
    return activePackages;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:14,代码来源:PackageInstallerCompatVL.java


示例9: addSessionInfoToCahce

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Thunk void addSessionInfoToCahce(SessionInfo info, UserHandleCompat user) {
    String packageName = info.getAppPackageName();
    if (packageName != null) {
        mCache.cachePackageInstallInfo(packageName, user, info.getAppIcon(),
                info.getAppLabel());
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:8,代码来源:PackageInstallerCompatVL.java


示例10: pushSessionDisplayToLauncher

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
private void pushSessionDisplayToLauncher(int sessionId) {
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if (session != null && session.getAppPackageName() != null) {
        addSessionInfoToCahce(session, UserHandleCompat.myUserHandle());
        LauncherAppState app = LauncherAppState.getInstanceNoCreate();

        if (app != null) {
            app.getModel().updateSessionDisplayInfo(session.getAppPackageName());
        }
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:12,代码来源:PackageInstallerCompatVL.java


示例11: onProgressChanged

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Override
public void onProgressChanged(int sessionId, float progress) {
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if (session != null) {
        sendUpdate(new PackageInstallInfo(session.getAppPackageName(),
                STATUS_INSTALLING,
                (int) (session.getProgress() * 100)));
    }
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:10,代码来源:PackageInstallerCompatVL.java


示例12: pushSessionDisplayToLauncher

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
private void pushSessionDisplayToLauncher(int sessionId) {
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if (session != null) {
        addSessionInfoToCahce(session, UserHandleCompat.myUserHandle());
        LauncherAppState app = LauncherAppState.getInstanceNoCreate();

        if (app != null) {
            app.getModel().updateSessionDisplayInfo(session.getAppPackageName());
        }
    }
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:12,代码来源:PackageInstallerCompatVL.java


示例13: updateAndGetActiveSessionCache

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Override
public HashSet<String> updateAndGetActiveSessionCache() {
    HashSet<String> activePackages = new HashSet<String>();
    UserHandleCompat user = UserHandleCompat.myUserHandle();
    for (SessionInfo info : mInstaller.getAllSessions()) {
        addSessionInfoToCahce(info, user);
        if (info.getAppPackageName() != null) {
            activePackages.add(info.getAppPackageName());
        }
    }
    return activePackages;
}
 
开发者ID:AndroidDeveloperLB,项目名称:LB-Launcher,代码行数:13,代码来源:PackageInstallerCompatVL.java


示例14: addSessionInfoToCahce

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
private void addSessionInfoToCahce(SessionInfo info, UserHandleCompat user) {
    String packageName = info.getAppPackageName();
    if (packageName != null) {
        mCache.cachePackageInstallInfo(packageName, user, info.getAppIcon(),
                info.getAppLabel());
    }
}
 
开发者ID:AndroidDeveloperLB,项目名称:LB-Launcher,代码行数:8,代码来源:PackageInstallerCompatVL.java


示例15: onFinished

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Override
public void onFinished(int sessionId, boolean success) {
    mPendingReplays.remove(sessionId);
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if ((session != null) && (session.getAppPackageName() != null)) {
        mPendingBadgeUpdates.remove(session.getAppPackageName());
        // Replay all updates with a one time update for this installed package. No
        // need to store this record for future updates, as the app list will get
        // refreshed on resume.
        replayUpdates(new PackageInstallInfo(session.getAppPackageName(),
                success ? STATUS_INSTALLED : STATUS_FAILED, 0));
    }
}
 
开发者ID:AndroidDeveloperLB,项目名称:LB-Launcher,代码行数:14,代码来源:PackageInstallerCompatVL.java


示例16: onProgressChanged

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
@Override
public void onProgressChanged(int sessionId, float progress) {
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if (session != null) {
        mPendingReplays.put(sessionId, session);
        replayUpdates(null);
    }
}
 
开发者ID:AndroidDeveloperLB,项目名称:LB-Launcher,代码行数:9,代码来源:PackageInstallerCompatVL.java


示例17: pushSessionBadgeToLauncher

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
private void pushSessionBadgeToLauncher(int sessionId) {
    SessionInfo session = mInstaller.getSessionInfo(sessionId);
    if (session != null) {
        addSessionInfoToCahce(session, UserHandleCompat.myUserHandle());
        if (session.getAppPackageName() != null) {
            mPendingBadgeUpdates.add(session.getAppPackageName());
        }
        mPendingReplays.put(sessionId, session);
        replayUpdates(null);
    }
}
 
开发者ID:AndroidDeveloperLB,项目名称:LB-Launcher,代码行数:12,代码来源:PackageInstallerCompatVL.java


示例18: zzi

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
static boolean zzi(Context paramContext, String paramString)
{
  boolean bool1 = true;
  if (zzq.zzdC(21))
  {
    Iterator localIterator = paramContext.getPackageManager().getPackageInstaller().getAllSessions().iterator();
    while (localIterator.hasNext()) {
      if (paramString.equals(((PackageInstaller.SessionInfo)localIterator.next()).getAppPackageName())) {
        return bool1;
      }
    }
  }
  if (zzq.zzdC(18))
  {
    Bundle localBundle = ((UserManager)paramContext.getSystemService("user")).getApplicationRestrictions(paramContext.getPackageName());
    if ((localBundle == null) || (!"true".equals(localBundle.getString("restricted_profile")))) {}
  }
  while (bool1)
  {
    return false;
    bool1 = false;
  }
  PackageManager localPackageManager = paramContext.getPackageManager();
  try
  {
    boolean bool2 = localPackageManager.getApplicationInfo(paramString, 8192).enabled;
    return bool2;
  }
  catch (PackageManager.NameNotFoundException localNameNotFoundException) {}
  return false;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:32,代码来源:GooglePlayServicesUtil.java


示例19: replayUpdates

import android.content.pm.PackageInstaller.SessionInfo; //导入依赖的package包/类
private void replayUpdates(PackageInstallInfo newInfo) {
    if (DEBUG) Log.d(TAG, "updates resumed");
    if (!mResumed || !mBound) {
        // Not yet ready
        return;
    }
    if ((mPendingReplays.size() == 0) && (newInfo == null)) {
        // Nothing to update
        return;
    }

    LauncherAppState app = LauncherAppState.getInstanceNoCreate();
    if (app == null) {
        // Try again later
        if (DEBUG) Log.d(TAG, "app is null, delaying send");
        return;
    }

    ArrayList<PackageInstallInfo> updates = new ArrayList<PackageInstallInfo>();
    if ((newInfo != null) && (newInfo.state != STATUS_INSTALLED)) {
        updates.add(newInfo);
    }
    for (int i = mPendingReplays.size() - 1; i >= 0; i--) {
        SessionInfo session = mPendingReplays.valueAt(i);
        if (session.getAppPackageName() != null) {
            updates.add(new PackageInstallInfo(session.getAppPackageName(),
                    STATUS_INSTALLING,
                    (int) (session.getProgress() * 100)));
        }
    }
    mPendingReplays.clear();
    if (!updates.isEmpty()) {
        app.setPackageState(updates);
    }

    if (!mPendingBadgeUpdates.isEmpty()) {
        for (String pkg : mPendingBadgeUpdates) {
            app.updatePackageBadge(pkg);
        }
        mPendingBadgeUpdates.clear();
    }
}
 
开发者ID:AndroidDeveloperLB,项目名称:LB-Launcher,代码行数:43,代码来源:PackageInstallerCompatVL.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StreamHeader12类代码示例发布时间:2022-05-23
下一篇:
Java TestElementProperty类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap