Example usage for android.app AppGlobals getPackageManager

List of usage examples for android.app AppGlobals getPackageManager

Introduction

In this page you can find the example usage for android.app AppGlobals getPackageManager.

Prototype

@UnsupportedAppUsage
public static IPackageManager getPackageManager() 

Source Link

Document

Return the raw interface to the package manager.

Usage

From source file:com.android.tv.settings.users.AppRestrictionsFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (savedInstanceState != null) {
        mUser = new UserHandle(savedInstanceState.getInt(EXTRA_USER_ID));
    } else {// w w w.j  a  v a 2  s. co m
        Bundle args = getArguments();
        if (args != null) {
            if (args.containsKey(EXTRA_USER_ID)) {
                mUser = new UserHandle(args.getInt(EXTRA_USER_ID));
            }
            mNewUser = args.getBoolean(EXTRA_NEW_USER, false);
        }
    }

    if (mUser == null) {
        mUser = android.os.Process.myUserHandle();
    }

    mHelper = new AppRestrictionsHelper(getContext(), mUser);
    mHelper.setLeanback(true);
    mPackageManager = getActivity().getPackageManager();
    mIPm = AppGlobals.getPackageManager();
    mUserManager = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
    mRestrictedProfile = mUserManager.getUserInfo(mUser.getIdentifier()).isRestricted();
    try {
        mSysPackageInfo = mPackageManager.getPackageInfo("android", PackageManager.GET_SIGNATURES);
    } catch (PackageManager.NameNotFoundException nnfe) {
        Log.e(TAG, "Could not find system package signatures", nnfe);
    }
    mAppList = getAppPreferenceGroup();
    mAppList.setOrderingAsAdded(false);
}