/*
* 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.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 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.ApplicationErrorReport;
import android.app.Dialog;
import android.app.IActivityController;
import android.app.IActivityManager;
import android.app.IActivityWatcher;
import android.app.IApplicationThread;
import android.app.IInstrumentationWatcher;
import android.app.IServiceConnection;
import android.app.IThumbnailReceiver;
import android.app.Instrumentation;
import android.app.Notification;
import android.app.PendingIntent;
import android.app.ResultInfo;
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.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.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.PowerManager;
import android.os.Process;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
import android.os.ServiceManager;
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.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManagerPolicy;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileNotFoundException;
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.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 {
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_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 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 happening.
static final long APP_SWITCH_DELAY_TIME = 5*1000;
// 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
// is being started.
static final boolean SHOW_APP_STARTING_ICON = true;
// How long we wait until giving up on the last activity to pause. This
// is short because it directly impacts the responsiveness of starting the
// next activity.
static final int PAUSE_TIMEOUT = 500;
/**
* How long we can hold the launch wake lock before giving up.
*/
static final int LAUNCH_TIMEOUT = 10*1000;
// How long we wait for a
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
android 2.2 sdk 源码 (17062个子文件)
ActivityManagerService.java 593KB
WindowManagerService.java 486KB
PackageManagerService.java 427KB
View.java 329KB
WebView.java 301KB
ContactsProvider2.java 258KB
TextView.java 255KB
FormatterTest.java 224KB
ScannerTest.java 219KB
ContactsContract.java 217KB
Intent.java 217KB
InCallScreen.java 214KB
LifecycleTest.java 202KB
ActivityThread.java 184KB
LoggerTest.java 181KB
Component.java 178KB
TextViewTest.java 163KB
ViewTest.java 158KB
FileChannelTest.java 158KB
DatagramChannelTest.java 157KB
BrowserActivity.java 156KB
Activity.java 156KB
CalendarProvider2.java 153KB
AbsListView.java 146KB
SocketChannelTest.java 143KB
LaunchTest.java 142KB
ContactsListActivity.java 140KB
InstructionSequenceConstants.java 139KB
MediaProvider.java 139KB
ImpsProvider.java 138KB
Settings.java 135KB
ContactsDatabaseHelper.java 135KB
ListView.java 134KB
ComposeMessageActivity.java 134KB
BatteryStatsImpl.java 132KB
ViewGroup.java 132KB
ViewRoot.java 129KB
Charset_TestGenerator_Res.java 129KB
DatabaseMetaData.java 127KB
PackageParser.java 126KB
CalendarView.java 124KB
SocketTest.java 122KB
ToStream.java 122KB
RIL.java 120KB
BigDecimalArithmeticTest.java 120KB
BigDecimal.java 120KB
BackupManagerService.java 115KB
PowerManagerService.java 110KB
ContactsProvider2Test.java 110KB
Character.java 109KB
DecimalFormatTest.java 108KB
SerializationStressTest4.java 108KB
ObjectInputStream.java 107KB
Collections.java 107KB
ActivityManagerNative.java 106KB
DatagramSocketTest.java 106KB
PreparedStatementTest.java 105KB
PackageManagerTests.java 105KB
PhoneUtils.java 103KB
SyncManager.java 102KB
ContextImpl.java 102KB
PhoneWindowManager.java 101KB
EmailContent.java 100KB
ParcelTest.java 100KB
RecurrenceProcessorTest.java 100KB
AudioTrackTest.java 100KB
ArraysTest.java 100KB
EasSyncService.java 99KB
HTMLReportGenerator.java 99KB
GLLogWrapper.java 99KB
JunitTestCases.java 98KB
CalendarSyncAdapter.java 98KB
PhoneWindow.java 98KB
Formatter.java 97KB
AudioService.java 97KB
parser.java 97KB
FileTest.java 97KB
TextUtilsTest.java 97KB
Term.java 97KB
EncryptedPrivateKeyInfoTest.java 96KB
BluetoothHandsfree.java 96KB
WebViewCore.java 95KB
X509CertSelectorTest.java 95KB
TransformerImpl.java 95KB
DatabaseMetaDataTest.java 95KB
LegacyApiSupport.java 94KB
SyncManager.java 93KB
DTMDocumentImpl.java 93KB
WifiStateTracker.java 93KB
HTMLSchema.java 93KB
MidWindow.java 92KB
MessagingController.java 92KB
SAX2DTM2.java 92KB
OpenWnnJAJP.java 91KB
DoubleTest.java 90KB
PKIXCertPathReviewer.java 90KB
ConnectionTest.java 90KB
AbstractQueuedSynchronizer.java 89KB
SQLiteDatabase.java 89KB
Contacts.java 89KB
共 17062 条
- 1
- 2
- 3
- 4
- 5
- 6
- 171
资源评论
daguaio_O
- 粉丝: 29
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功