Search in sources :

Example 1 with NotificationBackend

use of com.android.settings.notification.NotificationBackend in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ManageApplications method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    mApplicationsState = ApplicationsState.getInstance(getActivity().getApplication());
    Intent intent = getActivity().getIntent();
    Bundle args = getArguments();
    String className = args != null ? args.getString(EXTRA_CLASSNAME) : null;
    if (className == null) {
        className = intent.getComponent().getClassName();
    }
    if (className.equals(AllApplicationsActivity.class.getName())) {
        mShowSystem = true;
    } else if (className.equals(NotificationAppListActivity.class.getName())) {
        mListType = LIST_TYPE_NOTIFICATION;
        mNotifBackend = new NotificationBackend();
    } else if (className.equals(StorageUseActivity.class.getName())) {
        if (args != null && args.containsKey(EXTRA_VOLUME_UUID)) {
            mVolumeUuid = args.getString(EXTRA_VOLUME_UUID);
            mVolumeName = args.getString(EXTRA_VOLUME_NAME);
            mListType = LIST_TYPE_STORAGE;
        } else {
            // No volume selected, display a normal list, sorted by size.
            mListType = LIST_TYPE_MAIN;
        }
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(UsageAccessSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_USAGE_ACCESS;
    } else if (className.equals(HighPowerApplicationsActivity.class.getName())) {
        mListType = LIST_TYPE_HIGH_POWER;
        // Default to showing system.
        mShowSystem = true;
    } else if (className.equals(OverlaySettingsActivity.class.getName())) {
        mListType = LIST_TYPE_OVERLAY;
    } else if (className.equals(WriteSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_WRITE_SETTINGS;
    } else {
        mListType = LIST_TYPE_MAIN;
    }
    mFilter = getDefaultFilter();
    if (savedInstanceState != null) {
        mSortOrder = savedInstanceState.getInt(EXTRA_SORT_ORDER, mSortOrder);
        mShowSystem = savedInstanceState.getBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
        mShowSubstratum = savedInstanceState.getBoolean(EXTRA_SHOW_SUBSTRATUM, mShowSubstratum);
        mShowSubstratumIcons = savedInstanceState.getBoolean(EXTRA_SHOW_SUBSTRATUM_ICONS, mShowSubstratumIcons);
    }
    mInvalidSizeStr = getActivity().getText(R.string.invalid_size_value);
    mResetAppsHelper = new ResetAppsHelper(getActivity());
}
Also used : NotificationBackend(com.android.settings.notification.NotificationBackend) Bundle(android.os.Bundle) StorageUseActivity(com.android.settings.Settings.StorageUseActivity) HighPowerApplicationsActivity(com.android.settings.Settings.HighPowerApplicationsActivity) Intent(android.content.Intent) AllApplicationsActivity(com.android.settings.Settings.AllApplicationsActivity) WriteSettingsActivity(com.android.settings.Settings.WriteSettingsActivity)

Example 2 with NotificationBackend

use of com.android.settings.notification.NotificationBackend in project android_packages_apps_Settings by omnirom.

the class ManageApplications method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    mApplicationsState = ApplicationsState.getInstance(getActivity().getApplication());
    Intent intent = getActivity().getIntent();
    Bundle args = getArguments();
    String className = args != null ? args.getString(EXTRA_CLASSNAME) : null;
    if (className == null) {
        className = intent.getComponent().getClassName();
    }
    if (className.equals(AllApplicationsActivity.class.getName())) {
        mShowSystem = true;
    } else if (className.equals(NotificationAppListActivity.class.getName()) || this instanceof NotificationApps) {
        mListType = LIST_TYPE_NOTIFICATION;
        mNotifBackend = new NotificationBackend();
    } else if (className.equals(StorageUseActivity.class.getName())) {
        if (args != null && args.containsKey(EXTRA_VOLUME_UUID)) {
            mVolumeUuid = args.getString(EXTRA_VOLUME_UUID);
            mStorageType = args.getInt(EXTRA_STORAGE_TYPE, STORAGE_TYPE_DEFAULT);
            mListType = LIST_TYPE_STORAGE;
        } else {
            // No volume selected, display a normal list, sorted by size.
            mListType = LIST_TYPE_MAIN;
        }
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(UsageAccessSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_USAGE_ACCESS;
    } else if (className.equals(HighPowerApplicationsActivity.class.getName())) {
        mListType = LIST_TYPE_HIGH_POWER;
        // Default to showing system.
        mShowSystem = true;
    } else if (className.equals(OverlaySettingsActivity.class.getName())) {
        mListType = LIST_TYPE_OVERLAY;
    } else if (className.equals(WriteSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_WRITE_SETTINGS;
    } else if (className.equals(ManageExternalSourcesActivity.class.getName())) {
        mListType = LIST_TYPE_MANAGE_SOURCES;
    } else if (className.equals(GamesStorageActivity.class.getName())) {
        mListType = LIST_TYPE_GAMES;
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(MoviesStorageActivity.class.getName())) {
        mListType = LIST_TYPE_MOVIES;
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(Settings.PhotosStorageActivity.class.getName())) {
        mListType = LIST_TYPE_PHOTOGRAPHY;
        mSortOrder = R.id.sort_order_size;
        mStorageType = args.getInt(EXTRA_STORAGE_TYPE, STORAGE_TYPE_DEFAULT);
    } else {
        mListType = LIST_TYPE_MAIN;
    }
    mFilter = getDefaultFilter();
    mIsWorkOnly = args != null ? args.getBoolean(EXTRA_WORK_ONLY) : false;
    mWorkUserId = args != null ? args.getInt(EXTRA_WORK_ID) : NO_USER_SPECIFIED;
    if (savedInstanceState != null) {
        mSortOrder = savedInstanceState.getInt(EXTRA_SORT_ORDER, mSortOrder);
        mShowSystem = savedInstanceState.getBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
    }
    mInvalidSizeStr = getActivity().getText(R.string.invalid_size_value);
    mResetAppsHelper = new ResetAppsHelper(getActivity());
}
Also used : NotificationBackend(com.android.settings.notification.NotificationBackend) Bundle(android.os.Bundle) HighPowerApplicationsActivity(com.android.settings.Settings.HighPowerApplicationsActivity) NotificationAppListActivity(com.android.settings.Settings.NotificationAppListActivity) Intent(android.content.Intent) AllApplicationsActivity(com.android.settings.Settings.AllApplicationsActivity) WriteSettingsActivity(com.android.settings.Settings.WriteSettingsActivity) GamesStorageActivity(com.android.settings.Settings.GamesStorageActivity) StorageUseActivity(com.android.settings.Settings.StorageUseActivity)

Example 3 with NotificationBackend

use of com.android.settings.notification.NotificationBackend in project android_packages_apps_Settings by SudaMod.

the class ManageApplications method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    mApplicationsState = ApplicationsState.getInstance(getActivity().getApplication());
    Intent intent = getActivity().getIntent();
    Bundle args = getArguments();
    String className = args != null ? args.getString(EXTRA_CLASSNAME) : null;
    if (className == null) {
        className = intent.getComponent().getClassName();
    }
    if (className.equals(AllApplicationsActivity.class.getName())) {
        mShowSystem = true;
    } else if (className.equals(NotificationAppListActivity.class.getName()) || this instanceof NotificationApps) {
        mListType = LIST_TYPE_NOTIFICATION;
        mNotifBackend = new NotificationBackend();
    } else if (className.equals(StorageUseActivity.class.getName())) {
        if (args != null && args.containsKey(EXTRA_VOLUME_UUID)) {
            mVolumeUuid = args.getString(EXTRA_VOLUME_UUID);
            mStorageType = args.getInt(EXTRA_STORAGE_TYPE, STORAGE_TYPE_DEFAULT);
            mListType = LIST_TYPE_STORAGE;
        } else {
            // No volume selected, display a normal list, sorted by size.
            mListType = LIST_TYPE_MAIN;
        }
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(UsageAccessSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_USAGE_ACCESS;
    } else if (className.equals(HighPowerApplicationsActivity.class.getName())) {
        mListType = LIST_TYPE_HIGH_POWER;
        // Default to showing system.
        mShowSystem = true;
    } else if (className.equals(OverlaySettingsActivity.class.getName())) {
        mListType = LIST_TYPE_OVERLAY;
    } else if (className.equals(WriteSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_WRITE_SETTINGS;
    } else if (className.equals(ManageExternalSourcesActivity.class.getName())) {
        mListType = LIST_TYPE_MANAGE_SOURCES;
    } else if (className.equals(GamesStorageActivity.class.getName())) {
        mListType = LIST_TYPE_GAMES;
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(MoviesStorageActivity.class.getName())) {
        mListType = LIST_TYPE_MOVIES;
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(Settings.PhotosStorageActivity.class.getName())) {
        mListType = LIST_TYPE_PHOTOGRAPHY;
        mSortOrder = R.id.sort_order_size;
        mStorageType = args.getInt(EXTRA_STORAGE_TYPE, STORAGE_TYPE_DEFAULT);
    } else {
        mListType = LIST_TYPE_MAIN;
    }
    mFilter = getDefaultFilter();
    mIsWorkOnly = args != null ? args.getBoolean(EXTRA_WORK_ONLY) : false;
    mWorkUserId = args != null ? args.getInt(EXTRA_WORK_ID) : NO_USER_SPECIFIED;
    if (savedInstanceState != null) {
        mSortOrder = savedInstanceState.getInt(EXTRA_SORT_ORDER, mSortOrder);
        mShowSystem = savedInstanceState.getBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
    }
    mInvalidSizeStr = getActivity().getText(R.string.invalid_size_value);
    mResetAppsHelper = new ResetAppsHelper(getActivity());
}
Also used : NotificationBackend(com.android.settings.notification.NotificationBackend) Bundle(android.os.Bundle) HighPowerApplicationsActivity(com.android.settings.Settings.HighPowerApplicationsActivity) NotificationAppListActivity(com.android.settings.Settings.NotificationAppListActivity) Intent(android.content.Intent) AllApplicationsActivity(com.android.settings.Settings.AllApplicationsActivity) WriteSettingsActivity(com.android.settings.Settings.WriteSettingsActivity) GamesStorageActivity(com.android.settings.Settings.GamesStorageActivity) StorageUseActivity(com.android.settings.Settings.StorageUseActivity)

Example 4 with NotificationBackend

use of com.android.settings.notification.NotificationBackend in project android_packages_apps_Settings by DirtyUnicorns.

the class ManageApplications method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    mApplicationsState = ApplicationsState.getInstance(getActivity().getApplication());
    Intent intent = getActivity().getIntent();
    Bundle args = getArguments();
    String className = args != null ? args.getString(EXTRA_CLASSNAME) : null;
    if (className == null) {
        className = intent.getComponent().getClassName();
    }
    if (className.equals(AllApplicationsActivity.class.getName())) {
        mShowSystem = true;
    } else if (className.equals(NotificationAppListActivity.class.getName()) || this instanceof NotificationApps) {
        mListType = LIST_TYPE_NOTIFICATION;
        mNotifBackend = new NotificationBackend();
    } else if (className.equals(StorageUseActivity.class.getName())) {
        if (args != null && args.containsKey(EXTRA_VOLUME_UUID)) {
            mVolumeUuid = args.getString(EXTRA_VOLUME_UUID);
            mStorageType = args.getInt(EXTRA_STORAGE_TYPE, STORAGE_TYPE_DEFAULT);
            mListType = LIST_TYPE_STORAGE;
        } else {
            // No volume selected, display a normal list, sorted by size.
            mListType = LIST_TYPE_MAIN;
        }
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(UsageAccessSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_USAGE_ACCESS;
    } else if (className.equals(HighPowerApplicationsActivity.class.getName())) {
        mListType = LIST_TYPE_HIGH_POWER;
        // Default to showing system.
        mShowSystem = true;
    } else if (className.equals(OverlaySettingsActivity.class.getName())) {
        mListType = LIST_TYPE_OVERLAY;
    } else if (className.equals(WriteSettingsActivity.class.getName())) {
        mListType = LIST_TYPE_WRITE_SETTINGS;
    } else if (className.equals(ManageExternalSourcesActivity.class.getName())) {
        mListType = LIST_TYPE_MANAGE_SOURCES;
    } else if (className.equals(GamesStorageActivity.class.getName())) {
        mListType = LIST_TYPE_GAMES;
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(MoviesStorageActivity.class.getName())) {
        mListType = LIST_TYPE_MOVIES;
        mSortOrder = R.id.sort_order_size;
    } else if (className.equals(Settings.PhotosStorageActivity.class.getName())) {
        mListType = LIST_TYPE_PHOTOGRAPHY;
        mSortOrder = R.id.sort_order_size;
        mStorageType = args.getInt(EXTRA_STORAGE_TYPE, STORAGE_TYPE_DEFAULT);
    } else {
        mListType = LIST_TYPE_MAIN;
    }
    mFilter = getDefaultFilter();
    mIsWorkOnly = args != null ? args.getBoolean(EXTRA_WORK_ONLY) : false;
    mWorkUserId = args != null ? args.getInt(EXTRA_WORK_ID) : NO_USER_SPECIFIED;
    if (savedInstanceState != null) {
        mSortOrder = savedInstanceState.getInt(EXTRA_SORT_ORDER, mSortOrder);
        mShowSystem = savedInstanceState.getBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
    }
    mInvalidSizeStr = getActivity().getText(R.string.invalid_size_value);
    mResetAppsHelper = new ResetAppsHelper(getActivity());
}
Also used : NotificationBackend(com.android.settings.notification.NotificationBackend) Bundle(android.os.Bundle) HighPowerApplicationsActivity(com.android.settings.Settings.HighPowerApplicationsActivity) NotificationAppListActivity(com.android.settings.Settings.NotificationAppListActivity) Intent(android.content.Intent) AllApplicationsActivity(com.android.settings.Settings.AllApplicationsActivity) WriteSettingsActivity(com.android.settings.Settings.WriteSettingsActivity) GamesStorageActivity(com.android.settings.Settings.GamesStorageActivity) StorageUseActivity(com.android.settings.Settings.StorageUseActivity)

Example 5 with NotificationBackend

use of com.android.settings.notification.NotificationBackend in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class AppNotificationPreferenceControllerTest method updateState_shouldSetSummary.

@Test
public void updateState_shouldSetSummary() {
    final ApplicationsState.AppEntry appEntry = mock(ApplicationsState.AppEntry.class);
    appEntry.info = new ApplicationInfo();
    when(mFragment.getAppEntry()).thenReturn(appEntry);
    NotificationBackend backend = new NotificationBackend();
    ReflectionHelpers.setField(backend, "sUsageStatsManager", mock(IUsageStatsManager.class));
    ReflectionHelpers.setField(mController, "mBackend", new NotificationBackend());
    mController.displayPreference(mScreen);
    mController.updateState(mPreference);
    verify(mPreference).setSummary(any());
}
Also used : NotificationBackend(com.android.settings.notification.NotificationBackend) ApplicationsState(com.android.settingslib.applications.ApplicationsState) IUsageStatsManager(android.app.usage.IUsageStatsManager) ApplicationInfo(android.content.pm.ApplicationInfo) Test(org.junit.Test)

Aggregations

NotificationBackend (com.android.settings.notification.NotificationBackend)13 Intent (android.content.Intent)10 Bundle (android.os.Bundle)10 HighPowerApplicationsActivity (com.android.settings.Settings.HighPowerApplicationsActivity)9 StorageUseActivity (com.android.settings.Settings.StorageUseActivity)9 WriteSettingsActivity (com.android.settings.Settings.WriteSettingsActivity)9 GamesStorageActivity (com.android.settings.Settings.GamesStorageActivity)8 AllApplicationsActivity (com.android.settings.Settings.AllApplicationsActivity)7 NotificationAppListActivity (com.android.settings.Settings.NotificationAppListActivity)6 Activity (android.app.Activity)2 Settings (com.android.settings.Settings)2 ManageExternalSourcesActivity (com.android.settings.Settings.ManageExternalSourcesActivity)2 OverlaySettingsActivity (com.android.settings.Settings.OverlaySettingsActivity)2 UsageAccessSettingsActivity (com.android.settings.Settings.UsageAccessSettingsActivity)2 SettingsActivity (com.android.settings.SettingsActivity)2 AppStorageSettings (com.android.settings.applications.AppStorageSettings)2 ConfigureNotificationSettings (com.android.settings.notification.ConfigureNotificationSettings)2 NotificationManager (android.app.NotificationManager)1 IUsageStatsManager (android.app.usage.IUsageStatsManager)1 ApplicationInfo (android.content.pm.ApplicationInfo)1