/*
* Copyright (C) 2006-2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.am;
import com.android.internal.os.BatteryStatsImpl;
import com.android.internal.os.RuntimeInit;
import com.android.server.IntentResolver;
import com.android.server.ProcessMap;
import com.android.server.ProcessStats;
import com.android.server.SystemServer;
import com.android.server.Watchdog;
import com.android.server.WindowManagerService;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.ActivityThread;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.IActivityWatcher;
import android.app.IApplicationThread;
import android.app.IInstrumentationWatcher;
import android.app.IIntentReceiver;
import android.app.IIntentSender;
import android.app.IServiceConnection;
import android.app.IThumbnailReceiver;
import android.app.Instrumentation;
import android.app.PendingIntent;
import android.app.ResultInfo;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.ConfigurationInfo;
import android.content.pm.IPackageDataObserver;
import android.content.pm.IPackageManager;
import android.content.pm.InstrumentationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
import android.os.Environment;
import android.os.FileUtils;
import android.os.Handler;
import android.os.IBinder;
import android.os.IPermissionController;
import android.os.Looper;
import android.os.Message;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.PowerManager;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Checkin;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Config;
import android.util.EventLog;
import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.SparseArray;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManagerPolicy;
import dalvik.system.Zygote;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.lang.IllegalStateException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
public final class ActivityManagerService extends ActivityManagerNative implements Watchdog.Monitor {
static final String TAG = "ActivityManager";
static final boolean DEBUG = false;
static final boolean localLOGV = DEBUG ? Config.LOGD : Config.LOGV;
static final boolean DEBUG_SWITCH = localLOGV || false;
static final boolean DEBUG_TASKS = localLOGV || false;
static final boolean DEBUG_PAUSE = localLOGV || false;
static final boolean DEBUG_OOM_ADJ = localLOGV || false;
static final boolean DEBUG_TRANSITION = localLOGV || false;
static final boolean DEBUG_BROADCAST = localLOGV || false;
static final boolean DEBUG_SERVICE = localLOGV || false;
static final boolean DEBUG_VISBILITY = localLOGV || false;
static final boolean DEBUG_PROCESSES = localLOGV || false;
static final boolean DEBUG_USER_LEAVING = localLOGV || false;
static final boolean DEBUG_RESULTS = localLOGV || false;
static final boolean VALIDATE_TOKENS = false;
static final boolean SHOW_ACTIVITY_START_TIME = true;
// Control over CPU and battery monitoring.
static final long BATTERY_STATS_TIME = 30*60*1000; // write battery stats every 30 minutes.
static final boolean MONITOR_CPU_USAGE = true;
static final long MONITOR_CPU_MIN_TIME = 5*1000; // don't sample cpu less than every 5 seconds.
static final long MONITOR_CPU_MAX_TIME = 0x0fffffff; // wait possibly forever for next cpu sample.
static final boolean MONITOR_THREAD_CPU_USAGE = false;
// Event log tags
static final int LOG_CONFIGURATION_CHANGED = 2719;
static final int LOG_CPU = 2721;
static final int LOG_AM_FINISH_ACTIVITY = 30001;
static final int LOG_TASK_TO_FRONT = 30002;
static final int LOG_AM_NEW_INTENT = 30003;
static final int LOG_AM_CREATE_TASK = 30004;
static final int LOG_AM_CREATE_ACTIVITY = 30005;
static final int LOG_AM_RESTART_ACTIVITY = 30006;
static final int LOG_AM_RESUME_ACTIVITY = 30007;
static final int LOG_ANR = 30008;
static final int LOG_ACTIVITY_LAUNCH_TIME = 30009;
static final int LOG_AM_PROCESS_BOUND = 30010;
static final int LOG_AM_PROCESS_DIED = 30011;
static final int LOG_AM_FAILED_TO_PAUSE_ACTIVITY = 30012;
static final int LOG_AM_PAUSE_ACTIVITY = 30013;
static final int LOG_AM_PROCESS_START = 30014;
static final int LOG_AM_PROCESS_BAD = 30015;
static final int LOG_AM_PROCESS_GOOD = 30016;
static final int LOG_AM_LOW_MEMORY = 30017;
static final int LOG_AM_DESTROY_ACTIVITY = 30018;
static final int LOG_AM_RELAUNCH_RESUME_ACTIVITY = 30019;
static final int LOG_AM_RELAUNCH_ACTIVITY = 30020;
static final int LOG_AM_KILL_FOR_MEMORY = 30023;
static final int LOG_AM_BROADCAST_DISCARD_FILTER = 30024;
static final int LOG_AM_BROADCAST_DISCARD_APP = 30025;
static final int LOG_AM_CREATE_SERVICE = 30030;
static final int LOG_AM_DESTROY_SERVICE = 30031;
static final int LOG_AM_PROCESS_CRASHED_TOO_MUCH = 30032;
static final int LOG_AM_DROP_PROCESS = 30033;
static final int LOG_AM_SERVICE_CRASHED_TOO_MUCH = 30034;
static final int LOG_AM_SCHEDULE_SERVICE_RESTART = 30035;
static final int LOG_AM_PROVIDER_LOST_PROCESS = 30036;
static final int LOG_BOOT_PROGRESS_AMS_READY = 3040;
static final int LOG_BOOT_PROGRESS_ENABLE_SCREEN = 3050;
private static final String SYSTEM_SECURE = "ro.secure";
// This is the maximum number of application processes we would like
// to have running. Due to the asynchronous nature of things, we can
// temporarily go beyond this limit.
static final int MAX_PROCESSES = 2;
// Set to false to leave processes running indefinitely, relying on
// the kernel killing them as resources are required.
static final boolean ENFORCE_PROCESS_LIMIT = false;
// This is the maximum number of activities that we would like to have
// running at a given time.
static final int MAX_ACTIVITIES = 20;
// Maximum number of recent tasks that we can remember.
static final int MAX_RECENT_TASKS = 20;
// How long until we reset a task when the user returns to it. Currently
// 30 minutes.
static final long ACTIVITY_INACTIVE_RESET_TIME = 1000*60*30;
// Set to true to disable the icon that is shown while a new activity
//
没有合适的资源?快使用搜索试试~ 我知道了~
android1.5源码
共3749个文件
java:3469个
aidl:131个
html:122个
需积分: 0 33 下载量 152 浏览量
2010-11-05
17:04:23
上传
评论
收藏 8.46MB RAR 举报
温馨提示
android1.5源码,解压后将sources文件夹放到SDK的platform目录下的android-3或android-1.5下,即可在Eclipse中浏览源码(安装后需刷新项目或重启Eclipse)
资源推荐
资源详情
资源评论
收起资源包目录
android1.5源码 (3749个子文件)
IPackageManager.aidl 10KB
ITelephony.aidl 6KB
IWindowManager.aidl 5KB
IWindowSession.aidl 5KB
ISms.aidl 4KB
ISimPhoneBook.aidl 4KB
ILocationManager.aidl 3KB
IBluetoothDevice.aidl 2KB
IInputMethodManager.aidl 2KB
IInputContext.aidl 2KB
IMountService.aidl 2KB
IImPlugin.aidl 2KB
IWindow.aidl 2KB
IActivityWatcher.aidl 2KB
IAudioService.aidl 2KB
ICheckinService.aidl 2KB
IBatteryStats.aidl 2KB
IInputMethod.aidl 2KB
IWifiManager.aidl 2KB
IAppWidgetService.aidl 2KB
IInputMethodSession.aidl 2KB
IPhoneSubInfo.aidl 2KB
IMediaScannerService.aidl 2KB
ISyncAdapter.aidl 2KB
ITelephonyRegistry.aidl 1KB
IWallpaperService.aidl 1KB
IConnectivityManager.aidl 1KB
IClipboard.aidl 1KB
IPhoneStateListener.aidl 1KB
IPowerManager.aidl 1KB
ISyncContext.aidl 1KB
INotificationManager.aidl 1KB
IAlarmManager.aidl 1KB
IHardwareService.aidl 1KB
IInputMethodCallback.aidl 1KB
IBluetoothHeadset.aidl 1KB
INetStatService.aidl 1KB
IMediaScannerListener.aidl 1KB
IIntentReceiver.aidl 1KB
IInputMethodClient.aidl 1KB
ILocationListener.aidl 1KB
IInstrumentationWatcher.aidl 1KB
IPackageStatsObserver.aidl 1KB
IInputContextCallback.aidl 1024B
IGpsStatusListener.aidl 1021B
IStatusBar.aidl 1018B
IBluetoothA2dp.aidl 1014B
IExtendedNetworkService.aidl 1011B
NetworkInfo.aidl 1010B
IWallpaperServiceCallback.aidl 1005B
IUsageStats.aidl 1001B
IInputConnectionCallback.aidl 987B
IPackageDataObserver.aidl 979B
IAppWidgetHost.aidl 975B
IThumbnailReceiver.aidl 975B
IContentObserver.aidl 969B
IIntentSender.aidl 929B
ISensorService.aidl 925B
IParentalControlCallback.aidl 908B
IApplicationToken.aidl 882B
ISearchManager.aidl 862B
IServiceConnection.aidl 860B
IResultReceiver.aidl 853B
IActivityPendingResult.aidl 850B
IPackageInstallObserver.aidl 831B
IPackageDeleteObserver.aidl 818B
IPermissionController.aidl 815B
IMessenger.aidl 814B
IOnKeyguardExitResult.aidl 808B
ITransientNotification.aidl 803B
IRotationWatcher.aidl 801B
IBluetoothDeviceCallback.aidl 788B
WindowManager.aidl 744B
PermissionGroupInfo.aidl 742B
InstrumentationInfo.aidl 742B
ParcelFileDescriptor.aidl 740B
Configuration.aidl 738B
ApplicationInfo.aidl 738B
PkgUsageStats.aidl 737B
PermissionInfo.aidl 737B
NeighboringCellInfo.aidl 736B
ActivityInfo.aidl 735B
PackageStats.aidl 735B
ProviderInfo.aidl 735B
ResultReceiver.aidl 734B
ServiceInfo.aidl 734B
ResolveInfo.aidl 734B
PackageInfo.aidl 734B
Signature.aidl 732B
ServiceState.aidl 731B
PendingIntent.aidl 725B
MotionEvent.aidl 723B
Region.aidl 722B
Intent.aidl 722B
KeyEvent.aidl 720B
Rect.aidl 720B
Messenger.aidl 720B
Surface.aidl 718B
Message.aidl 718B
Bundle.aidl 712B
共 3749 条
- 1
- 2
- 3
- 4
- 5
- 6
- 38
资源评论
俺总在笑
- 粉丝: 30
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功