diff options
Diffstat (limited to 'src/com/android/settings/applications/ProcessStatsSummary.java')
-rw-r--r-- | src/com/android/settings/applications/ProcessStatsSummary.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/settings/applications/ProcessStatsSummary.java b/src/com/android/settings/applications/ProcessStatsSummary.java index dc24c73..2cf9445 100644 --- a/src/com/android/settings/applications/ProcessStatsSummary.java +++ b/src/com/android/settings/applications/ProcessStatsSummary.java @@ -1,5 +1,6 @@ /* * Copyright (C) 2015 The Android Open Source Project + * Copyright (C) 2016 The CyanogenMod Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +16,9 @@ */ package com.android.settings.applications; +import android.app.Activity; import android.content.Context; +import android.content.Intent; import android.os.Bundle; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; @@ -26,6 +29,7 @@ import android.widget.TextView; import com.android.internal.logging.MetricsLogger; import com.android.settings.R; +import com.android.settings.Settings.AppOpsSummaryActivity; import com.android.settings.Utils; import com.android.settings.applications.ProcStatsData.MemInfo; @@ -38,6 +42,9 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc private static final String KEY_AVERAGY_USED = "average_used"; private static final String KEY_FREE = "free"; private static final String KEY_APP_LIST = "apps_list"; + private static final String KEY_APP_STARTUP = "apps_startup"; + + private Activity mActivity; private LinearColorBar mColors; private LayoutPreference mHeader; @@ -48,11 +55,14 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc private Preference mAverageUsed; private Preference mFree; private Preference mAppListPreference; + private Preference mAppStartupPreference; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); + mActivity = getActivity(); + addPreferencesFromResource(R.xml.process_stats_summary); mHeader = (LayoutPreference) findPreference(KEY_STATUS_HEADER); mMemStatus = (TextView) mHeader.findViewById(R.id.memory_state); @@ -64,6 +74,8 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc mFree = findPreference(KEY_FREE); mAppListPreference = findPreference(KEY_APP_LIST); mAppListPreference.setOnPreferenceClickListener(this); + mAppStartupPreference = findPreference(KEY_APP_STARTUP); + mAppStartupPreference.setOnPreferenceClickListener(this); } @Override @@ -119,6 +131,12 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc startFragment(this, ProcessStatsUi.class.getName(), R.string.app_list_memory_use, 0, args); return true; + } else if (preference == mAppStartupPreference) { + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.putExtra("appops_tab", getString(R.string.app_ops_categories_bootup)); + intent.setClass(mActivity, AppOpsSummaryActivity.class); + mActivity.startActivity(intent); + return true; } return false; } |