Search in sources :

Example 1 with AppButtonsPreferenceController

use of com.android.settings.applications.appinfo.AppButtonsPreferenceController in project android_packages_apps_Settings by DirtyUnicorns.

the class AdvancedPowerUsageDetail method createPreferenceControllers.

@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final Bundle bundle = getArguments();
    final int uid = bundle.getInt(EXTRA_UID, 0);
    final String packageName = bundle.getString(EXTRA_PACKAGE_NAME);
    mBackgroundActivityPreferenceController = new BackgroundActivityPreferenceController(context, this, uid, packageName);
    controllers.add(mBackgroundActivityPreferenceController);
    controllers.add(new BatteryOptimizationPreferenceController((SettingsActivity) getActivity(), this, packageName));
    mAppButtonsPreferenceController = new AppButtonsPreferenceController((SettingsActivity) getActivity(), this, getSettingsLifecycle(), packageName, mState, REQUEST_UNINSTALL, REQUEST_REMOVE_DEVICE_ADMIN);
    controllers.add(mAppButtonsPreferenceController);
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) SettingsActivity(com.android.settings.SettingsActivity) AppButtonsPreferenceController(com.android.settings.applications.appinfo.AppButtonsPreferenceController)

Example 2 with AppButtonsPreferenceController

use of com.android.settings.applications.appinfo.AppButtonsPreferenceController in project android_packages_apps_Settings by AOSPA.

the class AdvancedPowerUsageDetail method createPreferenceControllers.

@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final Bundle bundle = getArguments();
    final int uid = bundle.getInt(EXTRA_UID, 0);
    final String packageName = bundle.getString(EXTRA_PACKAGE_NAME);
    mAppButtonsPreferenceController = new AppButtonsPreferenceController((SettingsActivity) getActivity(), this, getSettingsLifecycle(), packageName, mState, REQUEST_UNINSTALL, REQUEST_REMOVE_DEVICE_ADMIN);
    controllers.add(mAppButtonsPreferenceController);
    if (enableTriState) {
        controllers.add(new UnrestrictedPreferenceController(context, uid, packageName));
        controllers.add(new OptimizedPreferenceController(context, uid, packageName));
        controllers.add(new RestrictedPreferenceController(context, uid, packageName));
    } else {
        mBackgroundActivityPreferenceController = new BackgroundActivityPreferenceController(context, this, uid, packageName);
        controllers.add(mBackgroundActivityPreferenceController);
        controllers.add(new BatteryOptimizationPreferenceController((SettingsActivity) getActivity(), this, packageName));
    }
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) AppButtonsPreferenceController(com.android.settings.applications.appinfo.AppButtonsPreferenceController) SettingsActivity(com.android.settings.SettingsActivity)

Example 3 with AppButtonsPreferenceController

use of com.android.settings.applications.appinfo.AppButtonsPreferenceController in project packages_apps_Settings by PixelExperience.

the class AdvancedPowerUsageDetail method createPreferenceControllers.

@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final Bundle bundle = getArguments();
    final int uid = bundle.getInt(EXTRA_UID, 0);
    final String packageName = bundle.getString(EXTRA_PACKAGE_NAME);
    mAppButtonsPreferenceController = new AppButtonsPreferenceController((SettingsActivity) getActivity(), this, getSettingsLifecycle(), packageName, mState, REQUEST_UNINSTALL, REQUEST_REMOVE_DEVICE_ADMIN);
    controllers.add(mAppButtonsPreferenceController);
    if (enableTriState) {
        controllers.add(new UnrestrictedPreferenceController(context, uid, packageName));
        controllers.add(new OptimizedPreferenceController(context, uid, packageName));
        controllers.add(new RestrictedPreferenceController(context, uid, packageName));
    } else {
        mBackgroundActivityPreferenceController = new BackgroundActivityPreferenceController(context, this, uid, packageName);
        controllers.add(mBackgroundActivityPreferenceController);
        controllers.add(new BatteryOptimizationPreferenceController((SettingsActivity) getActivity(), this, packageName));
    }
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) AppButtonsPreferenceController(com.android.settings.applications.appinfo.AppButtonsPreferenceController) SettingsActivity(com.android.settings.SettingsActivity)

Example 4 with AppButtonsPreferenceController

use of com.android.settings.applications.appinfo.AppButtonsPreferenceController in project android_packages_apps_Settings by Project-Kaleidoscope.

the class AdvancedPowerUsageDetail method createPreferenceControllers.

@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final Bundle bundle = getArguments();
    final int uid = bundle.getInt(EXTRA_UID, 0);
    final String packageName = bundle.getString(EXTRA_PACKAGE_NAME);
    mAppButtonsPreferenceController = new AppButtonsPreferenceController((SettingsActivity) getActivity(), this, getSettingsLifecycle(), packageName, mState, REQUEST_UNINSTALL, REQUEST_REMOVE_DEVICE_ADMIN);
    controllers.add(mAppButtonsPreferenceController);
    if (enableTriState) {
        controllers.add(new UnrestrictedPreferenceController(context, uid, packageName));
        controllers.add(new OptimizedPreferenceController(context, uid, packageName));
        controllers.add(new RestrictedPreferenceController(context, uid, packageName));
    } else {
        mBackgroundActivityPreferenceController = new BackgroundActivityPreferenceController(context, this, uid, packageName);
        controllers.add(mBackgroundActivityPreferenceController);
        controllers.add(new BatteryOptimizationPreferenceController((SettingsActivity) getActivity(), this, packageName));
    }
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) AppButtonsPreferenceController(com.android.settings.applications.appinfo.AppButtonsPreferenceController) SettingsActivity(com.android.settings.SettingsActivity)

Example 5 with AppButtonsPreferenceController

use of com.android.settings.applications.appinfo.AppButtonsPreferenceController in project android_packages_apps_Settings by omnirom.

the class AdvancedPowerUsageDetail method createPreferenceControllers.

@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
    final List<AbstractPreferenceController> controllers = new ArrayList<>();
    final Bundle bundle = getArguments();
    final int uid = bundle.getInt(EXTRA_UID, 0);
    final String packageName = bundle.getString(EXTRA_PACKAGE_NAME);
    mAppButtonsPreferenceController = new AppButtonsPreferenceController((SettingsActivity) getActivity(), this, getSettingsLifecycle(), packageName, mState, REQUEST_UNINSTALL, REQUEST_REMOVE_DEVICE_ADMIN);
    controllers.add(mAppButtonsPreferenceController);
    if (enableTriState) {
        controllers.add(new UnrestrictedPreferenceController(context, uid, packageName));
        controllers.add(new OptimizedPreferenceController(context, uid, packageName));
        controllers.add(new RestrictedPreferenceController(context, uid, packageName));
    } else {
        mBackgroundActivityPreferenceController = new BackgroundActivityPreferenceController(context, this, uid, packageName);
        controllers.add(mBackgroundActivityPreferenceController);
        controllers.add(new BatteryOptimizationPreferenceController((SettingsActivity) getActivity(), this, packageName));
    }
    return controllers;
}
Also used : AbstractPreferenceController(com.android.settingslib.core.AbstractPreferenceController) Bundle(android.os.Bundle) ArrayList(java.util.ArrayList) AppButtonsPreferenceController(com.android.settings.applications.appinfo.AppButtonsPreferenceController) SettingsActivity(com.android.settings.SettingsActivity)

Aggregations

Bundle (android.os.Bundle)14 SettingsActivity (com.android.settings.SettingsActivity)14 AppButtonsPreferenceController (com.android.settings.applications.appinfo.AppButtonsPreferenceController)14 AbstractPreferenceController (com.android.settingslib.core.AbstractPreferenceController)14 ArrayList (java.util.ArrayList)14