Search in sources :

Example 11 with LauncherApps

use of android.content.pm.LauncherApps in project android_frameworks_base by crdroidandroid.

the class AppWidgetHostView method updateContentDescription.

private void updateContentDescription(AppWidgetProviderInfo info) {
    if (info != null) {
        LauncherApps launcherApps = getContext().getSystemService(LauncherApps.class);
        ApplicationInfo appInfo = launcherApps.getApplicationInfo(info.provider.getPackageName(), 0, info.getProfile());
        if (appInfo != null && (appInfo.flags & ApplicationInfo.FLAG_SUSPENDED) != 0) {
            setContentDescription(Resources.getSystem().getString(com.android.internal.R.string.suspended_widget_accessibility, info.label));
        } else {
            setContentDescription(info.label);
        }
    }
}
Also used : ApplicationInfo(android.content.pm.ApplicationInfo) LauncherApps(android.content.pm.LauncherApps)

Aggregations

LauncherApps (android.content.pm.LauncherApps)11 ApplicationInfo (android.content.pm.ApplicationInfo)7 Intent (android.content.Intent)4 LauncherActivityInfo (android.content.pm.LauncherActivityInfo)3 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)2 UserManager (android.os.UserManager)2 UserHandle (fr.neamar.kiss.utils.UserHandle)2 ActivityNotFoundException (android.content.ActivityNotFoundException)1 BroadcastReceiver (android.content.BroadcastReceiver)1 Context (android.content.Context)1 IntentFilter (android.content.IntentFilter)1 PackageManager (android.content.pm.PackageManager)1 ResolveInfo (android.content.pm.ResolveInfo)1 PopupMenu (android.widget.PopupMenu)1 MainActivity (fr.neamar.kiss.MainActivity)1 LoadAppPojos (fr.neamar.kiss.loader.LoadAppPojos)1 AppPojo (fr.neamar.kiss.pojo.AppPojo)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1