From b9eb2865af05d9ade572e71934a9e6a50421aa7d Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Fri, 14 Jun 2013 20:17:30 -0400 Subject: Memory tracking is now handled by a service. Multiple processes may be tracked and viewed simultaneously. Also, some changes to the graph: * show uss and pss together * adjust opacity controls Change-Id: I20eebaa8cc8faf78b46af2a35d71ee538207f02b --- src/com/android/launcher3/LauncherAppState.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/com/android/launcher3/LauncherAppState.java') diff --git a/src/com/android/launcher3/LauncherAppState.java b/src/com/android/launcher3/LauncherAppState.java index af9acb152..aeafcf084 100644 --- a/src/com/android/launcher3/LauncherAppState.java +++ b/src/com/android/launcher3/LauncherAppState.java @@ -17,16 +17,15 @@ package com.android.launcher3; import android.app.SearchManager; -import android.content.ContentResolver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; +import android.content.*; import android.content.res.Configuration; import android.database.ContentObserver; import android.net.Uri; import android.os.Debug; import android.os.Environment; import android.os.Handler; +import android.os.IBinder; +import android.util.Log; import java.io.File; import java.io.IOException; @@ -63,10 +62,21 @@ public class LauncherAppState { private LauncherAppState() { } private void initialize(Context context) { + Log.v(Launcher.TAG, "LauncherAppState initialize() called in process " + android.os.Process.myPid()); + mContext = context; mStarttime = System.currentTimeMillis(); + if (context.getResources().getBoolean(R.bool.debug_memory_enabled)) { + context.startService(new Intent(context, MemoryTracker.class) + .setAction(MemoryTracker.ACTION_START_TRACKING) + .putExtra("pid", android.os.Process.myPid()) + .putExtra("name", "L") + ); + } + + // set sIsScreenXLarge and sScreenDensity *before* creating icon cache sIsScreenLarge = context.getResources().getBoolean(R.bool.is_large_screen); sScreenDensity = context.getResources().getDisplayMetrics().density; -- cgit v1.2.3