From d0689c0328f2aabf9954face86e1e574fbdd8864 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 10 Sep 2012 14:43:16 -0700 Subject: [PATCH] Remove use of private API. Change-Id: I6c1e586af108cb1d94120295181d89c5050f5bc2 --- .../src/com/android/development/PackageSummary.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/Development/src/com/android/development/PackageSummary.java b/apps/Development/src/com/android/development/PackageSummary.java index d621d4e67..452f4d700 100644 --- a/apps/Development/src/com/android/development/PackageSummary.java +++ b/apps/Development/src/com/android/development/PackageSummary.java @@ -17,7 +17,7 @@ package com.android.development; import android.app.Activity; -import android.app.ActivityManagerNative; +import android.app.ActivityManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -30,7 +30,6 @@ import android.content.pm.ProviderInfo; import android.content.pm.ServiceInfo; import android.net.Uri; import android.os.Bundle; -import android.os.RemoteException; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -39,7 +38,6 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; - public class PackageSummary extends Activity { String mPackageName; @@ -151,10 +149,9 @@ public class PackageSummary extends Activity { mRestart.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - try { - ActivityManagerNative.getDefault().killBackgroundProcesses(mPackageName); - } catch (RemoteException e) { - } + ActivityManager am = (ActivityManager)getSystemService( + Context.ACTIVITY_SERVICE); + am.killBackgroundProcesses(mPackageName); } });