Improve shutdown process to send broadcast for applications.

This introduces a new class in the base platform for performing a clean
shutdown (which was copied from the classes in the policies).  It
includes new features to send a shutdown broadcast for applications
to do cleanup, and ot have the activity manager pause the current
activity before proceeding with the shutdown.  These facilities are
also use to write at the most recent stat files for sync, battery
and user activity.
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 2ac6160..56b29c1 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -16,7 +16,6 @@
 
 package android.app;
 
-import android.app.ActivityManager.MemoryInfo;
 import android.content.ComponentName;
 import android.content.ContentProviderNative;
 import android.content.IContentProvider;
@@ -34,7 +33,6 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.ParcelFileDescriptor;
-import android.text.TextUtils;
 import android.os.Bundle;
 
 import java.util.List;
@@ -225,6 +223,8 @@
     public boolean profileControl(String process, boolean start,
             String path) throws RemoteException;
     
+    public boolean shutdown(int timeout) throws RemoteException;
+    
     /*
      * Private non-Binder interfaces
      */
@@ -370,4 +370,5 @@
     int GET_DEVICE_CONFIGURATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+83;
     int PEEK_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+84;
     int PROFILE_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+85;
+    int SHUTDOWN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+86;
 }