Search in sources :

Example 1 with INetworkStatsService

use of android.net.INetworkStatsService in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class InstalledAppDetails method onCreate.

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    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);
    }
    mBatteryHelper = new BatteryStatsHelper(getActivity(), true);
}
Also used : INetworkStatsService(android.net.INetworkStatsService) RemoteException(android.os.RemoteException) BatteryStatsHelper(com.android.internal.os.BatteryStatsHelper)

Example 2 with INetworkStatsService

use of android.net.INetworkStatsService 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 3 with INetworkStatsService

use of android.net.INetworkStatsService 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 4 with INetworkStatsService

use of android.net.INetworkStatsService 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 5 with INetworkStatsService

use of android.net.INetworkStatsService 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)

Aggregations

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