Search in sources :

Example 1 with DevelopmentSettingsEnabler

use of com.android.settings.development.DevelopmentSettingsEnabler in project android_packages_apps_Settings by omnirom.

the class InstalledAppDetails method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    final Activity activity = getActivity();
    if (!ensurePackageInfoAvailable(activity)) {
        return;
    }
    setHasOptionsMenu(true);
    addPreferencesFromResource(R.xml.installed_app_details);
    addDynamicPrefs();
    if (Utils.isBandwidthControlEnabled()) {
        INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
        try {
            mStatsSession = statsService.openSession();
        } catch (RemoteException e) {
            throw new RuntimeException(e);
        }
    } else {
        removePreference(KEY_DATA);
    }
    mBatteryUtils = BatteryUtils.getInstance(getContext());
    mDevelopmentSettingsEnabler = new DevelopmentSettingsEnabler(activity, null);
}
Also used : DevelopmentSettingsEnabler(com.android.settings.development.DevelopmentSettingsEnabler) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity) INetworkStatsService(android.net.INetworkStatsService) RemoteException(android.os.RemoteException)

Example 2 with DevelopmentSettingsEnabler

use of com.android.settings.development.DevelopmentSettingsEnabler in project android_packages_apps_Settings by crdroidandroid.

the class InstalledAppDetails method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    final Activity activity = getActivity();
    if (!ensurePackageInfoAvailable(activity)) {
        return;
    }
    setHasOptionsMenu(true);
    addPreferencesFromResource(R.xml.installed_app_details);
    addDynamicPrefs();
    if (Utils.isBandwidthControlEnabled()) {
        INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
        try {
            mStatsSession = statsService.openSession();
        } catch (RemoteException e) {
            throw new RuntimeException(e);
        }
    } else {
        removePreference(KEY_DATA);
    }
    mBatteryUtils = BatteryUtils.getInstance(getContext());
    mDevelopmentSettingsEnabler = new DevelopmentSettingsEnabler(activity, null);
}
Also used : DevelopmentSettingsEnabler(com.android.settings.development.DevelopmentSettingsEnabler) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity) INetworkStatsService(android.net.INetworkStatsService) RemoteException(android.os.RemoteException)

Example 3 with DevelopmentSettingsEnabler

use of com.android.settings.development.DevelopmentSettingsEnabler in project android_packages_apps_Settings by SudaMod.

the class InstalledAppDetails method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    final Activity activity = getActivity();
    if (!ensurePackageInfoAvailable(activity)) {
        return;
    }
    setHasOptionsMenu(true);
    addPreferencesFromResource(R.xml.installed_app_details);
    addDynamicPrefs();
    if (Utils.isBandwidthControlEnabled()) {
        INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
        try {
            mStatsSession = statsService.openSession();
        } catch (RemoteException e) {
            throw new RuntimeException(e);
        }
    } else {
        removePreference(KEY_DATA);
    }
    mBatteryUtils = BatteryUtils.getInstance(getContext());
    mDevelopmentSettingsEnabler = new DevelopmentSettingsEnabler(activity, null);
}
Also used : DevelopmentSettingsEnabler(com.android.settings.development.DevelopmentSettingsEnabler) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity) INetworkStatsService(android.net.INetworkStatsService) RemoteException(android.os.RemoteException)

Example 4 with DevelopmentSettingsEnabler

use of com.android.settings.development.DevelopmentSettingsEnabler in project platform_packages_apps_Settings by BlissRoms.

the class InstalledAppDetails method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    final Activity activity = getActivity();
    if (!ensurePackageInfoAvailable(activity)) {
        return;
    }
    setHasOptionsMenu(true);
    addPreferencesFromResource(R.xml.installed_app_details);
    addDynamicPrefs();
    if (Utils.isBandwidthControlEnabled()) {
        INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
        try {
            mStatsSession = statsService.openSession();
        } catch (RemoteException e) {
            throw new RuntimeException(e);
        }
    } else {
        removePreference(KEY_DATA);
    }
    mBatteryUtils = BatteryUtils.getInstance(getContext());
    mDevelopmentSettingsEnabler = new DevelopmentSettingsEnabler(activity, null);
}
Also used : DevelopmentSettingsEnabler(com.android.settings.development.DevelopmentSettingsEnabler) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity) INetworkStatsService(android.net.INetworkStatsService) RemoteException(android.os.RemoteException)

Example 5 with DevelopmentSettingsEnabler

use of com.android.settings.development.DevelopmentSettingsEnabler in project android_packages_apps_Settings by LineageOS.

the class InstalledAppDetails method onCreate.

/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    final Activity activity = getActivity();
    if (!ensurePackageInfoAvailable(activity)) {
        return;
    }
    setHasOptionsMenu(true);
    addPreferencesFromResource(R.xml.installed_app_details);
    addDynamicPrefs();
    if (Utils.isBandwidthControlEnabled()) {
        INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
        try {
            mStatsSession = statsService.openSession();
        } catch (RemoteException e) {
            throw new RuntimeException(e);
        }
    } else {
        removePreference(KEY_DATA);
    }
    mBatteryUtils = BatteryUtils.getInstance(getContext());
    mDevelopmentSettingsEnabler = new DevelopmentSettingsEnabler(activity, null);
}
Also used : DevelopmentSettingsEnabler(com.android.settings.development.DevelopmentSettingsEnabler) SettingsActivity(com.android.settings.SettingsActivity) Activity(android.app.Activity) INetworkStatsService(android.net.INetworkStatsService) RemoteException(android.os.RemoteException)

Aggregations

Activity (android.app.Activity)6 INetworkStatsService (android.net.INetworkStatsService)6 RemoteException (android.os.RemoteException)6 SettingsActivity (com.android.settings.SettingsActivity)6 DevelopmentSettingsEnabler (com.android.settings.development.DevelopmentSettingsEnabler)6