/*
* 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.R;
import com.android.internal.os.BatteryStatsImpl;
import com.android.server.AttributeCache;
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 com.android.server.am.ActivityStack.ActivityState;
import dalvik.system.Zygote;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.ActivityThread;
import android.app.AlertDialog;
import android.app.AppGlobals;
import android.app.ApplicationErrorReport;
import android.app.Dialog;
import android.app.IActivityController;
import android.app.IActivityWatcher;
import android.app.IApplicationThread;
import android.app.IInstrumentationWatcher;
import android.app.INotificationManager;
import android.app.IServiceConnection;
import android.app.IThumbnailReceiver;
import android.app.Instrumentation;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.app.backup.IBackupManager;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IIntentReceiver;
import android.content.IIntentSender;
import android.content.IntentSender;
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.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PathPermission;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.DropBoxManager;
import android.os.Environment;
import android.os.FileObserver;
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.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.StrictMode;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Settings;
import android.util.Config;
import android.util.EventLog;
import android.util.Slog;
import android.util.Log;
import android.util.PrintWriterPrinter;
import android.util.SparseArray;
import android.util.TimeUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManagerPolicy;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.IllegalStateException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
public final class ActivityManagerService extends ActivityManagerNative
implements Watchdog.Monitor, BatteryStatsImpl.BatteryCallback {
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_BROADCAST_LIGHT = DEBUG_BROADCAST || false;
static final boolean DEBUG_SERVICE = localLOGV || false;
static final boolean DEBUG_SERVICE_EXECUTING = localLOGV || false;
static final boolean DEBUG_VISBILITY = localLOGV || false;
static final boolean DEBUG_PROCESSES = localLOGV || false;
static final boolean DEBUG_PROVIDER = localLOGV || false;
static final boolean DEBUG_URI_PERMISSION = localLOGV || false;
static final boolean DEBUG_USER_LEAVING = localLOGV || false;
static final boolean DEBUG_RESULTS = localLOGV || false;
static final boolean DEBUG_BACKUP = localLOGV || false;
static final boolean DEBUG_CONFIGURATION = localLOGV || false;
static final boolean DEBUG_POWER = localLOGV || false;
static final boolean DEBUG_POWER_QUICK = DEBUG_POWER || 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;
// The flags that are set for all calls we make to the package manager.
static final int STOCK_PM_FLAGS = PackageManager.GET_SHARED_LIBRARY_FILES;
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;
// Amount of time after a call to stopAppSwitches() during which we will
// prevent further untrusted switches from hap
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
eclipse查看Android源代码 (1853个子文件)
IPackageManager.aidl 12KB
ISms.aidl 7KB
IBackupTransport.aidl 7KB
ITelephony.aidl 7KB
IWindowManager.aidl 6KB
IBackupManager.aidl 6KB
IWindowSession.aidl 6KB
IContentService.aidl 5KB
ISipSession.aidl 5KB
INetworkManagementService.aidl 5KB
ISipSessionListener.aidl 4KB
ILocationManager.aidl 4KB
IIccPhoneBook.aidl 4KB
IRestoreSession.aidl 3KB
IBackupAgent.aidl 3KB
IBatteryStats.aidl 3KB
IBluetooth.aidl 3KB
IAccountManager.aidl 3KB
IAccountAuthenticator.aidl 3KB
IRecognitionListener.aidl 2KB
IAudioService.aidl 2KB
IRecognitionService.aidl 2KB
IInputMethodManager.aidl 2KB
IRestoreObserver.aidl 2KB
ITts.aidl 2KB
IWindow.aidl 2KB
IInputContext.aidl 2KB
IWifiManager.aidl 2KB
IConnectivityManager.aidl 2KB
IDevicePolicyManager.aidl 2KB
IActivityController.aidl 2KB
ISyncAdapter.aidl 2KB
INfcAdapter.aidl 2KB
IWallpaperManager.aidl 2KB
IInputMethod.aidl 2KB
IPhoneSubInfo.aidl 2KB
IInputMethodSession.aidl 2KB
IAppWidgetService.aidl 2KB
IStatusBarService.aidl 2KB
IPowerManager.aidl 2KB
ILocationProvider.aidl 2KB
IMediaScannerService.aidl 2KB
ITelephonyRegistry.aidl 2KB
IBluetoothHeadset.aidl 2KB
INotificationManager.aidl 2KB
IBluetoothA2dp.aidl 1KB
ISipService.aidl 1KB
IPhoneStateListener.aidl 1KB
IUiModeManager.aidl 1KB
IDropBoxManagerService.aidl 1KB
IClipboard.aidl 1KB
INetworkManagementEventObserver.aidl 1KB
IVpnService.aidl 1KB
IMediaContainerService.aidl 1KB
IGeocodeProvider.aidl 1KB
IAlarmManager.aidl 1KB
IAccessibilityManager.aidl 1KB
ISyncContext.aidl 1KB
INfcTag.aidl 1KB
IStatusBar.aidl 1KB
IInputMethodCallback.aidl 1KB
ILlcpSocket.aidl 1KB
IThrottleManager.aidl 1KB
INetStatService.aidl 1KB
IIntentReceiver.aidl 1KB
IMediaScannerListener.aidl 1KB
IInputContextCallback.aidl 1KB
ISearchManager.aidl 1KB
IEventListener.aidl 1KB
IGpsStatusListener.aidl 1KB
IInputMethodClient.aidl 1KB
IUsageStats.aidl 1KB
ILocationListener.aidl 1KB
IInstrumentationWatcher.aidl 1KB
IPackageStatsObserver.aidl 1KB
IAccessibilityServiceConnection.aidl 1017B
IExtendedNetworkService.aidl 1009B
NetworkInfo.aidl 1008B
IWallpaperManagerCallback.aidl 1005B
IInputConnectionCallback.aidl 987B
IPackageDataObserver.aidl 979B
IThumbnailReceiver.aidl 975B
IAppWidgetHost.aidl 975B
IContentObserver.aidl 969B
IBluetoothPbap.aidl 968B
IGpsStatusProvider.aidl 947B
IAccountAuthenticatorResponse.aidl 943B
IAccountManagerResponse.aidl 922B
IWallpaperService.aidl 916B
ILlcpConnectionlessSocket.aidl 901B
IWallpaperEngine.aidl 900B
IP2pTarget.aidl 899B
IWallpaperConnection.aidl 898B
IAccessibilityManagerClient.aidl 891B
IApplicationToken.aidl 882B
IIntentSender.aidl 869B
IUrlRendererService.aidl 869B
IActivityWatcher.aidl 867B
IServiceConnection.aidl 860B
IAudioFocusDispatcher.aidl 860B
共 1853 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19
资源评论
- Ryan201201012016-10-20资源内容太少了。
- q7001002014-05-15实用啊,终于可以看到源代码了
- 萨拉曼2014-12-16不错,这个代码确实比较实用~~
yewenpeng1
- 粉丝: 6
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功