use of com.android.settings.applications.AppStateInstallAppsBridge.InstallAppsState in project android_packages_apps_Settings by omnirom.
the class ExternalSourcesDetails method getPreferenceSummary.
static CharSequence getPreferenceSummary(Context context, AppEntry entry) {
final UserManager um = UserManager.get(context);
final int userRestrictionSource = um.getUserRestrictionSource(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, UserHandle.getUserHandleForUid(entry.info.uid));
switch(userRestrictionSource) {
case UserManager.RESTRICTION_SOURCE_DEVICE_OWNER:
case UserManager.RESTRICTION_SOURCE_PROFILE_OWNER:
return context.getString(R.string.disabled_by_admin);
case UserManager.RESTRICTION_SOURCE_SYSTEM:
return context.getString(R.string.disabled);
}
final InstallAppsState appsState = new AppStateInstallAppsBridge(context, null, null).createInstallAppsStateFor(entry.info.packageName, entry.info.uid);
return context.getString(appsState.canInstallApps() ? R.string.app_permission_summary_allowed : R.string.app_permission_summary_not_allowed);
}
use of com.android.settings.applications.AppStateInstallAppsBridge.InstallAppsState in project android_packages_apps_Settings by DirtyUnicorns.
the class ExternalSourcesDetails method getPreferenceSummary.
static CharSequence getPreferenceSummary(Context context, AppEntry entry) {
final UserManager um = UserManager.get(context);
final int userRestrictionSource = um.getUserRestrictionSource(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, UserHandle.getUserHandleForUid(entry.info.uid));
switch(userRestrictionSource) {
case UserManager.RESTRICTION_SOURCE_DEVICE_OWNER:
case UserManager.RESTRICTION_SOURCE_PROFILE_OWNER:
return context.getString(R.string.disabled_by_admin);
case UserManager.RESTRICTION_SOURCE_SYSTEM:
return context.getString(R.string.disabled);
}
final InstallAppsState appsState = new AppStateInstallAppsBridge(context, null, null).createInstallAppsStateFor(entry.info.packageName, entry.info.uid);
return context.getString(appsState.canInstallApps() ? R.string.app_permission_summary_allowed : R.string.app_permission_summary_not_allowed);
}
use of com.android.settings.applications.AppStateInstallAppsBridge.InstallAppsState in project platform_packages_apps_Settings by BlissRoms.
the class ExternalSourcesDetails method getPreferenceSummary.
static CharSequence getPreferenceSummary(Context context, AppEntry entry) {
final UserManager um = UserManager.get(context);
final int userRestrictionSource = um.getUserRestrictionSource(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, UserHandle.getUserHandleForUid(entry.info.uid));
switch(userRestrictionSource) {
case UserManager.RESTRICTION_SOURCE_DEVICE_OWNER:
case UserManager.RESTRICTION_SOURCE_PROFILE_OWNER:
return context.getString(R.string.disabled_by_admin);
case UserManager.RESTRICTION_SOURCE_SYSTEM:
return context.getString(R.string.disabled);
}
final InstallAppsState appsState = new AppStateInstallAppsBridge(context, null, null).createInstallAppsStateFor(entry.info.packageName, entry.info.uid);
return context.getString(appsState.canInstallApps() ? R.string.app_permission_summary_allowed : R.string.app_permission_summary_not_allowed);
}
use of com.android.settings.applications.AppStateInstallAppsBridge.InstallAppsState in project android_packages_apps_Settings by LineageOS.
the class ExternalSourcesDetails method getPreferenceSummary.
static CharSequence getPreferenceSummary(Context context, AppEntry entry) {
final UserManager um = UserManager.get(context);
final int userRestrictionSource = um.getUserRestrictionSource(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, UserHandle.getUserHandleForUid(entry.info.uid));
switch(userRestrictionSource) {
case UserManager.RESTRICTION_SOURCE_DEVICE_OWNER:
case UserManager.RESTRICTION_SOURCE_PROFILE_OWNER:
return context.getString(R.string.disabled_by_admin);
case UserManager.RESTRICTION_SOURCE_SYSTEM:
return context.getString(R.string.disabled);
}
final InstallAppsState appsState = new AppStateInstallAppsBridge(context, null, null).createInstallAppsStateFor(entry.info.packageName, entry.info.uid);
return context.getString(appsState.canInstallApps() ? R.string.app_permission_summary_allowed : R.string.app_permission_summary_not_allowed);
}
use of com.android.settings.applications.AppStateInstallAppsBridge.InstallAppsState in project android_packages_apps_Settings by crdroidandroid.
the class ExternalSourcesDetails method getPreferenceSummary.
static CharSequence getPreferenceSummary(Context context, AppEntry entry) {
final UserManager um = UserManager.get(context);
final int userRestrictionSource = um.getUserRestrictionSource(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, UserHandle.getUserHandleForUid(entry.info.uid));
switch(userRestrictionSource) {
case UserManager.RESTRICTION_SOURCE_DEVICE_OWNER:
case UserManager.RESTRICTION_SOURCE_PROFILE_OWNER:
return context.getString(R.string.disabled_by_admin);
case UserManager.RESTRICTION_SOURCE_SYSTEM:
return context.getString(R.string.disabled);
}
final InstallAppsState appsState = new AppStateInstallAppsBridge(context, null, null).createInstallAppsStateFor(entry.info.packageName, entry.info.uid);
return context.getString(appsState.canInstallApps() ? R.string.app_permission_summary_allowed : R.string.app_permission_summary_not_allowed);
}
Aggregations