resolved conflicts for merge of 6a3eddb4
to master
Change-Id: I1ca1d100274d4a733ef2bf58b0d5d7217b4f858e
This commit is contained in:
@ -3352,7 +3352,7 @@ public final class ActivityThread {
|
||||
while (i.hasNext()) {
|
||||
ProviderInfo cpi = i.next();
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
buf.append("Publishing provider ");
|
||||
buf.append("Pub ");
|
||||
buf.append(cpi.authority);
|
||||
buf.append(": ");
|
||||
buf.append(cpi.name);
|
||||
|
@ -1730,6 +1730,11 @@ public class PackageParser {
|
||||
|
||||
XmlUtils.skipCurrentTag(parser);
|
||||
|
||||
} else if (tagName.equals("uses-package")) {
|
||||
// Dependencies for app installers; we don't currently try to
|
||||
// enforce this.
|
||||
XmlUtils.skipCurrentTag(parser);
|
||||
|
||||
} else {
|
||||
if (!RIGID_PARSER) {
|
||||
Log.w(TAG, "Unknown element under <application>: " + tagName
|
||||
|
@ -45,7 +45,7 @@ import android.text.TextUtils;
|
||||
public class MobileDataStateTracker implements NetworkStateTracker {
|
||||
|
||||
private static final String TAG = "MobileDataStateTracker";
|
||||
private static final boolean DBG = true;
|
||||
private static final boolean DBG = false;
|
||||
|
||||
private Phone.DataState mMobileDataState;
|
||||
private ITelephony mPhoneService;
|
||||
|
@ -71,20 +71,6 @@
|
||||
<item>@drawable/indicator_code_lock_point_area_default</item>
|
||||
<item>@drawable/indicator_code_lock_point_area_green</item>
|
||||
<item>@drawable/indicator_code_lock_point_area_red</item>
|
||||
<!-- SlidingTab drawables shared by InCallScreen and LockScreen -->
|
||||
<item>@drawable/jog_tab_bar_left_end_confirm_gray</item>
|
||||
<item>@drawable/jog_tab_bar_left_end_normal</item>
|
||||
<item>@drawable/jog_tab_bar_left_end_pressed</item>
|
||||
<item>@drawable/jog_tab_bar_right_end_confirm_gray</item>
|
||||
<item>@drawable/jog_tab_bar_right_end_normal</item>
|
||||
<item>@drawable/jog_tab_bar_right_end_pressed</item>
|
||||
<item>@drawable/jog_tab_left_confirm_gray</item>
|
||||
<item>@drawable/jog_tab_left_normal</item>
|
||||
<item>@drawable/jog_tab_left_pressed</item>
|
||||
<item>@drawable/jog_tab_right_confirm_gray</item>
|
||||
<item>@drawable/jog_tab_right_normal</item>
|
||||
<item>@drawable/jog_tab_right_pressed</item>
|
||||
<item>@drawable/jog_tab_target_gray</item>
|
||||
</array>
|
||||
|
||||
<!-- Do not translate. These are all of the color state list resources that should be
|
||||
|
@ -68,7 +68,7 @@ import java.net.UnknownHostException;
|
||||
*/
|
||||
public class ConnectivityService extends IConnectivityManager.Stub {
|
||||
|
||||
private static final boolean DBG = true;
|
||||
private static final boolean DBG = false;
|
||||
private static final String TAG = "ConnectivityService";
|
||||
|
||||
// how long to wait before switching back to a radio's default network
|
||||
|
@ -58,6 +58,7 @@ import android.view.WindowManagerPolicy;
|
||||
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.PrintWriter;
|
||||
@ -605,6 +606,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
Slog.w(TAG, "failed parsing " + file + " " + e);
|
||||
} catch (XmlPullParserException e) {
|
||||
Slog.w(TAG, "failed parsing " + file + " " + e);
|
||||
} catch (FileNotFoundException e) {
|
||||
// Don't be noisy, this is normal if we haven't defined any policies.
|
||||
} catch (IOException e) {
|
||||
Slog.w(TAG, "failed parsing " + file + " " + e);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
|
@ -951,10 +951,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
}
|
||||
|
||||
public void updateStatusIcon(IBinder token, String packageName, int iconId) {
|
||||
int uid = Binder.getCallingUid();
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
if (token == null || mCurToken != token) {
|
||||
Slog.w(TAG, "Ignoring setInputMethod of token: " + token);
|
||||
Slog.w(TAG, "Ignoring setInputMethod of uid " + uid + " token: " + token);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1048,6 +1049,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
|
||||
public boolean showSoftInput(IInputMethodClient client, int flags,
|
||||
ResultReceiver resultReceiver) {
|
||||
int uid = Binder.getCallingUid();
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
synchronized (mMethodMap) {
|
||||
@ -1058,7 +1060,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
// focus in the window manager, to allow this call to
|
||||
// be made before input is started in it.
|
||||
if (!mIWindowManager.inputMethodClientHasFocus(client)) {
|
||||
Slog.w(TAG, "Ignoring showSoftInput of: " + client);
|
||||
Slog.w(TAG, "Ignoring showSoftInput of uid " + uid + ": " + client);
|
||||
return false;
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
@ -1112,6 +1114,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
|
||||
public boolean hideSoftInput(IInputMethodClient client, int flags,
|
||||
ResultReceiver resultReceiver) {
|
||||
int uid = Binder.getCallingUid();
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
synchronized (mMethodMap) {
|
||||
@ -1122,7 +1125,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
// focus in the window manager, to allow this call to
|
||||
// be made before input is started in it.
|
||||
if (!mIWindowManager.inputMethodClientHasFocus(client)) {
|
||||
Slog.w(TAG, "Ignoring hideSoftInput of: " + client);
|
||||
if (DEBUG) Slog.w(TAG, "Ignoring hideSoftInput of uid "
|
||||
+ uid + ": " + client);
|
||||
return false;
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
@ -1257,7 +1261,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
synchronized (mMethodMap) {
|
||||
if (mCurClient == null || client == null
|
||||
|| mCurClient.client.asBinder() != client.asBinder()) {
|
||||
Slog.w(TAG, "Ignoring showInputMethodDialogFromClient of: " + client);
|
||||
Slog.w(TAG, "Ignoring showInputMethodDialogFromClient of uid "
|
||||
+ Binder.getCallingUid() + ": " + client);
|
||||
}
|
||||
|
||||
mHandler.sendEmptyMessage(MSG_SHOW_IM_PICKER);
|
||||
@ -1290,7 +1295,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
+ android.Manifest.permission.WRITE_SECURE_SETTINGS);
|
||||
}
|
||||
} else if (mCurToken != token) {
|
||||
Slog.w(TAG, "Ignoring setInputMethod of token: " + token);
|
||||
Slog.w(TAG, "Ignoring setInputMethod of uid " + Binder.getCallingUid()
|
||||
+ " token: " + token);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1306,7 +1312,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
public void hideMySoftInput(IBinder token, int flags) {
|
||||
synchronized (mMethodMap) {
|
||||
if (token == null || mCurToken != token) {
|
||||
Slog.w(TAG, "Ignoring hideInputMethod of token: " + token);
|
||||
if (DEBUG) Slog.w(TAG, "Ignoring hideInputMethod of uid "
|
||||
+ Binder.getCallingUid() + " token: " + token);
|
||||
return;
|
||||
}
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
@ -1321,7 +1328,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
||||
public void showMySoftInput(IBinder token, int flags) {
|
||||
synchronized (mMethodMap) {
|
||||
if (token == null || mCurToken != token) {
|
||||
Slog.w(TAG, "Ignoring hideInputMethod of token: " + token);
|
||||
Slog.w(TAG, "Ignoring showMySoftInput of uid "
|
||||
+ Binder.getCallingUid() + " token: " + token);
|
||||
return;
|
||||
}
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
|
@ -28,6 +28,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.PrintWriterPrinter;
|
||||
import android.util.Slog;
|
||||
import android.util.LogPrinter;
|
||||
import android.util.Printer;
|
||||
@ -92,10 +93,12 @@ public class IntentResolver<F extends IntentFilter, R extends Object> {
|
||||
}
|
||||
|
||||
boolean dumpMap(PrintWriter out, String titlePrefix, String title,
|
||||
String prefix, Map<String, ArrayList<F>> map, String packageName) {
|
||||
String prefix, Map<String, ArrayList<F>> map, String packageName,
|
||||
boolean printFilter) {
|
||||
String eprefix = prefix + " ";
|
||||
String fprefix = prefix + " ";
|
||||
boolean printedSomething = false;
|
||||
Printer printer = null;
|
||||
for (Map.Entry<String, ArrayList<F>> e : map.entrySet()) {
|
||||
ArrayList<F> a = e.getValue();
|
||||
final int N = a.size();
|
||||
@ -115,37 +118,44 @@ public class IntentResolver<F extends IntentFilter, R extends Object> {
|
||||
}
|
||||
printedSomething = true;
|
||||
dumpFilter(out, fprefix, filter);
|
||||
if (printFilter) {
|
||||
if (printer == null) {
|
||||
printer = new PrintWriterPrinter(out);
|
||||
}
|
||||
filter.dump(printer, fprefix + " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
return printedSomething;
|
||||
}
|
||||
|
||||
public boolean dump(PrintWriter out, String title, String prefix, String packageName) {
|
||||
public boolean dump(PrintWriter out, String title, String prefix, String packageName,
|
||||
boolean printFilter) {
|
||||
String innerPrefix = prefix + " ";
|
||||
String sepPrefix = "\n" + prefix;
|
||||
String curPrefix = title + "\n" + prefix;
|
||||
if (dumpMap(out, curPrefix, "Full MIME Types:", innerPrefix,
|
||||
mTypeToFilter, packageName)) {
|
||||
mTypeToFilter, packageName, printFilter)) {
|
||||
curPrefix = sepPrefix;
|
||||
}
|
||||
if (dumpMap(out, curPrefix, "Base MIME Types:", innerPrefix,
|
||||
mBaseTypeToFilter, packageName)) {
|
||||
mBaseTypeToFilter, packageName, printFilter)) {
|
||||
curPrefix = sepPrefix;
|
||||
}
|
||||
if (dumpMap(out, curPrefix, "Wild MIME Types:", innerPrefix,
|
||||
mWildTypeToFilter, packageName)) {
|
||||
mWildTypeToFilter, packageName, printFilter)) {
|
||||
curPrefix = sepPrefix;
|
||||
}
|
||||
if (dumpMap(out, curPrefix, "Schemes:", innerPrefix,
|
||||
mSchemeToFilter, packageName)) {
|
||||
mSchemeToFilter, packageName, printFilter)) {
|
||||
curPrefix = sepPrefix;
|
||||
}
|
||||
if (dumpMap(out, curPrefix, "Non-Data Actions:", innerPrefix,
|
||||
mActionToFilter, packageName)) {
|
||||
mActionToFilter, packageName, printFilter)) {
|
||||
curPrefix = sepPrefix;
|
||||
}
|
||||
if (dumpMap(out, curPrefix, "MIME Typed Actions:", innerPrefix,
|
||||
mTypedActionToFilter, packageName)) {
|
||||
mTypedActionToFilter, packageName, printFilter)) {
|
||||
curPrefix = sepPrefix;
|
||||
}
|
||||
return curPrefix == sepPrefix;
|
||||
|
@ -55,7 +55,7 @@ import java.util.concurrent.CountDownLatch;
|
||||
class NetworkManagementService extends INetworkManagementService.Stub {
|
||||
|
||||
private static final String TAG = "NetworkManagmentService";
|
||||
private static final boolean DBG = true;
|
||||
private static final boolean DBG = false;
|
||||
private static final String NETD_TAG = "NetdConnector";
|
||||
|
||||
class NetdResponseCode {
|
||||
|
@ -1102,27 +1102,6 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
final File permFile = new File(Environment.getRootDirectory(),
|
||||
"etc/permissions/platform.xml");
|
||||
readPermissionsFromXml(permFile);
|
||||
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
sb.append("Libs:");
|
||||
Iterator<String> it = mSharedLibraries.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
sb.append(' ');
|
||||
String name = it.next();
|
||||
sb.append(name);
|
||||
sb.append(':');
|
||||
sb.append(mSharedLibraries.get(name));
|
||||
}
|
||||
Log.i(TAG, sb.toString());
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append("Features:");
|
||||
it = mAvailableFeatures.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
sb.append(' ');
|
||||
sb.append(it.next());
|
||||
}
|
||||
Log.i(TAG, sb.toString());
|
||||
}
|
||||
|
||||
private void readPermissionsFromXml(File permFile) {
|
||||
@ -2632,7 +2611,7 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
// The system package has been updated and the code path does not match
|
||||
// Ignore entry. Skip it.
|
||||
Log.i(TAG, "Package " + ps.name + " at " + scanFile
|
||||
+ "ignored: updated version " + ps.versionCode
|
||||
+ " ignored: updated version " + ps.versionCode
|
||||
+ " better than this " + pkg.mVersionCode);
|
||||
mLastScanError = PackageManager.INSTALL_FAILED_DUPLICATE_PACKAGE;
|
||||
return null;
|
||||
@ -6866,7 +6845,18 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean dumpStar = true;
|
||||
boolean dumpLibs = false;
|
||||
boolean dumpFeatures = false;
|
||||
boolean dumpResolvers = false;
|
||||
boolean dumpPermissions = false;
|
||||
boolean dumpPackages = false;
|
||||
boolean dumpSharedUsers = false;
|
||||
boolean dumpMessages = false;
|
||||
boolean dumpProviders = false;
|
||||
|
||||
String packageName = null;
|
||||
boolean showFilters = false;
|
||||
|
||||
int opti = 0;
|
||||
while (opti < args.length) {
|
||||
@ -6879,10 +6869,22 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
// Right now we only know how to print all.
|
||||
} else if ("-h".equals(opt)) {
|
||||
pw.println("Package manager dump options:");
|
||||
pw.println(" [-h] [cmd] ...");
|
||||
pw.println(" [-h] [-f] [cmd] ...");
|
||||
pw.println(" -f: print details of intent filters");
|
||||
pw.println(" -h: print this help");
|
||||
pw.println(" cmd may be one of:");
|
||||
pw.println(" [package.name]: info about given package");
|
||||
pw.println(" l[ibraries]: list known shared libraries");
|
||||
pw.println(" f[ibraries]: list device features");
|
||||
pw.println(" r[esolvers]: dump intent resolvers");
|
||||
pw.println(" perm[issions]: dump permissions");
|
||||
pw.println(" prov[iders]: dump content providers");
|
||||
pw.println(" p[ackages]: dump installed packages");
|
||||
pw.println(" s[hared-users]: dump shared user IDs");
|
||||
pw.println(" m[essages]: print collected runtime messages");
|
||||
pw.println(" <package.name>: info about given package");
|
||||
return;
|
||||
} else if ("-f".equals(opt)) {
|
||||
showFilters = true;
|
||||
} else {
|
||||
pw.println("Unknown argument: " + opt + "; use -h for help");
|
||||
}
|
||||
@ -6895,32 +6897,87 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
// Is this a package name?
|
||||
if ("android".equals(cmd) || cmd.contains(".")) {
|
||||
packageName = cmd;
|
||||
} else if ("l".equals(cmd) || "libraries".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpLibs = true;
|
||||
} else if ("f".equals(cmd) || "features".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpFeatures = true;
|
||||
} else if ("r".equals(cmd) || "resolvers".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpResolvers = true;
|
||||
} else if ("perm".equals(cmd) || "permissions".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpPermissions = true;
|
||||
} else if ("p".equals(cmd) || "packages".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpPackages = true;
|
||||
} else if ("s".equals(cmd) || "shared-users".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpSharedUsers = true;
|
||||
} else if ("prov".equals(cmd) || "providers".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpProviders = true;
|
||||
} else if ("m".equals(cmd) || "messages".equals(cmd)) {
|
||||
dumpStar = false;
|
||||
dumpMessages = true;
|
||||
}
|
||||
}
|
||||
|
||||
boolean printedTitle = false;
|
||||
|
||||
synchronized (mPackages) {
|
||||
if (mActivities.dump(pw, "Activity Resolver Table:", " ", packageName)) {
|
||||
if ((dumpStar || dumpLibs) && packageName == null) {
|
||||
if (printedTitle) pw.println(" ");
|
||||
printedTitle = true;
|
||||
pw.println("Libraries:");
|
||||
Iterator<String> it = mSharedLibraries.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
String name = it.next();
|
||||
pw.print(" ");
|
||||
pw.print(name);
|
||||
pw.print(" -> ");
|
||||
pw.println(mSharedLibraries.get(name));
|
||||
}
|
||||
}
|
||||
|
||||
if ((dumpStar || dumpFeatures) && packageName == null) {
|
||||
if (printedTitle) pw.println(" ");
|
||||
printedTitle = true;
|
||||
pw.println("Features:");
|
||||
Iterator<String> it = mAvailableFeatures.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
String name = it.next();
|
||||
pw.print(" ");
|
||||
pw.println(name);
|
||||
}
|
||||
}
|
||||
|
||||
if (dumpStar || dumpResolvers) {
|
||||
if (mActivities.dump(pw, printedTitle
|
||||
? "\nActivity Resolver Table:" : "Activity Resolver Table:",
|
||||
" ", packageName, showFilters)) {
|
||||
printedTitle = true;
|
||||
}
|
||||
if (mReceivers.dump(pw, printedTitle
|
||||
? "\nReceiver Resolver Table:" : "Receiver Resolver Table:",
|
||||
" ", packageName)) {
|
||||
" ", packageName, showFilters)) {
|
||||
printedTitle = true;
|
||||
}
|
||||
if (mServices.dump(pw, printedTitle
|
||||
? "\nService Resolver Table:" : "Service Resolver Table:",
|
||||
" ", packageName)) {
|
||||
" ", packageName, showFilters)) {
|
||||
printedTitle = true;
|
||||
}
|
||||
if (mSettings.mPreferredActivities.dump(pw, printedTitle
|
||||
? "\nPreferred Activities:" : "Preferred Activities:",
|
||||
" ", packageName)) {
|
||||
" ", packageName, showFilters)) {
|
||||
printedTitle = true;
|
||||
}
|
||||
}
|
||||
|
||||
boolean printedSomething = false;
|
||||
{
|
||||
if (dumpStar || dumpPermissions) {
|
||||
for (BasePermission p : mSettings.mPermissions.values()) {
|
||||
if (packageName != null && !packageName.equals(p.sourcePackage)) {
|
||||
continue;
|
||||
@ -6947,9 +7004,27 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dumpStar || dumpProviders) {
|
||||
printedSomething = false;
|
||||
for (PackageParser.Provider p : mProviders.values()) {
|
||||
if (packageName != null && !packageName.equals(p.info.packageName)) {
|
||||
continue;
|
||||
}
|
||||
if (!printedSomething) {
|
||||
if (printedTitle) pw.println(" ");
|
||||
pw.println("Registered ContentProviders:");
|
||||
printedSomething = true;
|
||||
printedTitle = true;
|
||||
}
|
||||
pw.print(" ["); pw.print(p.info.authority); pw.print("]: ");
|
||||
pw.println(p.toString());
|
||||
}
|
||||
}
|
||||
|
||||
printedSomething = false;
|
||||
SharedUserSetting packageSharedUser = null;
|
||||
{
|
||||
if (dumpStar || dumpPackages) {
|
||||
for (PackageSetting ps : mSettings.mPackages.values()) {
|
||||
if (packageName != null && !packageName.equals(ps.realName)
|
||||
&& !packageName.equals(ps.name)) {
|
||||
@ -7052,6 +7127,7 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
}
|
||||
}
|
||||
printedSomething = false;
|
||||
if (dumpStar || dumpPackages) {
|
||||
if (mSettings.mRenamedPackages.size() > 0) {
|
||||
for (HashMap.Entry<String, String> e
|
||||
: mSettings.mRenamedPackages.entrySet()) {
|
||||
@ -7096,8 +7172,9 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
pw.print(" resourcePath="); pw.println(ps.resourcePathString);
|
||||
}
|
||||
}
|
||||
}
|
||||
printedSomething = false;
|
||||
{
|
||||
if (dumpStar || dumpSharedUsers) {
|
||||
for (SharedUserSetting su : mSettings.mSharedUsers.values()) {
|
||||
if (packageName != null && su != packageSharedUser) {
|
||||
continue;
|
||||
@ -7120,11 +7197,11 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
if (packageName == null) {
|
||||
if ((dumpStar || dumpMessages) && packageName == null) {
|
||||
if (printedTitle) pw.println(" ");
|
||||
printedTitle = true;
|
||||
pw.println("Settings parse messages:");
|
||||
pw.println(mSettings.mReadMessages.toString());
|
||||
pw.print(mSettings.mReadMessages.toString());
|
||||
|
||||
pw.println(" ");
|
||||
pw.println("Package warning messages:");
|
||||
@ -7135,29 +7212,12 @@ class PackageManagerService extends IPackageManager.Stub {
|
||||
int avail = in.available();
|
||||
byte[] data = new byte[avail];
|
||||
in.read(data);
|
||||
pw.println(new String(data));
|
||||
pw.print(new String(data));
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
synchronized (mProviders) {
|
||||
boolean printedSomething = false;
|
||||
for (PackageParser.Provider p : mProviders.values()) {
|
||||
if (packageName != null && !packageName.equals(p.info.packageName)) {
|
||||
continue;
|
||||
}
|
||||
if (!printedSomething) {
|
||||
if (printedTitle) pw.println(" ");
|
||||
pw.println("Registered ContentProviders:");
|
||||
printedSomething = true;
|
||||
printedTitle = true;
|
||||
}
|
||||
pw.print(" ["); pw.print(p.info.authority); pw.print("]: ");
|
||||
pw.println(p.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static final class BasePermission {
|
||||
|
@ -113,9 +113,15 @@ 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;
|
||||
@ -6123,6 +6129,76 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
return mSystemReady;
|
||||
}
|
||||
|
||||
private static File getCalledPreBootReceiversFile() {
|
||||
File dataDir = Environment.getDataDirectory();
|
||||
File systemDir = new File(dataDir, "system");
|
||||
File fname = new File(systemDir, "called_pre_boots.dat");
|
||||
return fname;
|
||||
}
|
||||
|
||||
private static ArrayList<ComponentName> readLastDonePreBootReceivers() {
|
||||
ArrayList<ComponentName> lastDoneReceivers = new ArrayList<ComponentName>();
|
||||
File file = getCalledPreBootReceiversFile();
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
fis = new FileInputStream(file);
|
||||
DataInputStream dis = new DataInputStream(new BufferedInputStream(fis, 2048));
|
||||
int vers = dis.readInt();
|
||||
String codename = dis.readUTF();
|
||||
if (vers == android.os.Build.VERSION.SDK_INT
|
||||
&& codename.equals(android.os.Build.VERSION.CODENAME)) {
|
||||
int num = dis.readInt();
|
||||
while (num > 0) {
|
||||
num--;
|
||||
String pkg = dis.readUTF();
|
||||
String cls = dis.readUTF();
|
||||
lastDoneReceivers.add(new ComponentName(pkg, cls));
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (IOException e) {
|
||||
Slog.w(TAG, "Failure reading last done pre-boot receivers", e);
|
||||
} finally {
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return lastDoneReceivers;
|
||||
}
|
||||
|
||||
private static void writeLastDonePreBootReceivers(ArrayList<ComponentName> list) {
|
||||
File file = getCalledPreBootReceiversFile();
|
||||
FileOutputStream fos = null;
|
||||
DataOutputStream dos = null;
|
||||
try {
|
||||
Slog.i(TAG, "Writing new set of last done pre-boot receivers...");
|
||||
fos = new FileOutputStream(file);
|
||||
dos = new DataOutputStream(new BufferedOutputStream(fos, 2048));
|
||||
dos.writeInt(android.os.Build.VERSION.SDK_INT);
|
||||
dos.writeUTF(android.os.Build.VERSION.CODENAME);
|
||||
dos.writeInt(list.size());
|
||||
for (int i=0; i<list.size(); i++) {
|
||||
dos.writeUTF(list.get(i).getPackageName());
|
||||
dos.writeUTF(list.get(i).getClassName());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Slog.w(TAG, "Failure writing last done pre-boot receivers", e);
|
||||
file.delete();
|
||||
} finally {
|
||||
if (dos != null) {
|
||||
try {
|
||||
dos.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void systemReady(final Runnable goingCallback) {
|
||||
// In the simulator, startRunning will never have been called, which
|
||||
// normally sets a few crucial variables. Do it here instead.
|
||||
@ -6157,9 +6233,24 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
}
|
||||
}
|
||||
intent.addFlags(Intent.FLAG_RECEIVER_BOOT_UPGRADE);
|
||||
|
||||
ArrayList<ComponentName> lastDoneReceivers = readLastDonePreBootReceivers();
|
||||
|
||||
final ArrayList<ComponentName> doneReceivers = new ArrayList<ComponentName>();
|
||||
for (int i=0; i<ris.size(); i++) {
|
||||
ActivityInfo ai = ris.get(i).activityInfo;
|
||||
intent.setComponent(new ComponentName(ai.packageName, ai.name));
|
||||
ComponentName comp = new ComponentName(ai.packageName, ai.name);
|
||||
if (lastDoneReceivers.contains(comp)) {
|
||||
ris.remove(i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<ris.size(); i++) {
|
||||
ActivityInfo ai = ris.get(i).activityInfo;
|
||||
ComponentName comp = new ComponentName(ai.packageName, ai.name);
|
||||
doneReceivers.add(comp);
|
||||
intent.setComponent(comp);
|
||||
IIntentReceiver finisher = null;
|
||||
if (i == ris.size()-1) {
|
||||
finisher = new IIntentReceiver.Stub() {
|
||||
@ -6174,6 +6265,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
synchronized (ActivityManagerService.this) {
|
||||
mDidUpdate = true;
|
||||
}
|
||||
writeLastDonePreBootReceivers(doneReceivers);
|
||||
systemReady(goingCallback);
|
||||
}
|
||||
});
|
||||
@ -6213,20 +6305,20 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
}
|
||||
}
|
||||
|
||||
if (procsToKill != null) {
|
||||
synchronized(this) {
|
||||
if (procsToKill != null) {
|
||||
for (int i=procsToKill.size()-1; i>=0; i--) {
|
||||
ProcessRecord proc = procsToKill.get(i);
|
||||
Slog.i(TAG, "Removing system update proc: " + proc);
|
||||
removeProcessLocked(proc, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Now that we have cleaned up any update processes, we
|
||||
// are ready to start launching real processes and know that
|
||||
// we won't trample on them any more.
|
||||
mProcessesReady = true;
|
||||
}
|
||||
}
|
||||
|
||||
Slog.i(TAG, "System now ready");
|
||||
EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_AMS_READY,
|
||||
@ -7741,7 +7833,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
|
||||
pw.println(" ");
|
||||
pw.println("Receiver Resolver Table:");
|
||||
mReceiverResolver.dump(pw, null, " ", null);
|
||||
mReceiverResolver.dump(pw, null, " ", null, false);
|
||||
needSep = true;
|
||||
}
|
||||
|
||||
|
@ -444,10 +444,11 @@ class ActivityRecord extends IApplicationToken.Stub {
|
||||
sb.append(shortComponentName);
|
||||
sb.append(": ");
|
||||
TimeUtils.formatDuration(thisTime, sb);
|
||||
if (thisTime != totalTime) {
|
||||
sb.append(" (total ");
|
||||
TimeUtils.formatDuration(totalTime, sb);
|
||||
sb.append(totalTime);
|
||||
sb.append(")");
|
||||
}
|
||||
Log.i(ActivityManagerService.TAG, sb.toString());
|
||||
}
|
||||
stack.reportActivityLaunchedLocked(false, this, thisTime, totalTime);
|
||||
|
@ -1881,7 +1881,7 @@ public class ActivityStack {
|
||||
String resultWho, int requestCode,
|
||||
int callingPid, int callingUid, boolean onlyIfNeeded,
|
||||
boolean componentSpecified) {
|
||||
Slog.i(TAG, "Starting activity: " + intent);
|
||||
Slog.i(TAG, "Starting: " + intent);
|
||||
|
||||
ActivityRecord sourceRecord = null;
|
||||
ActivityRecord resultRecord = null;
|
||||
|
@ -57,6 +57,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||
public final class UsageStatsService extends IUsageStats.Stub {
|
||||
public static final String SERVICE_NAME = "usagestats";
|
||||
private static final boolean localLOGV = false;
|
||||
private static final boolean REPORT_UNEXPECTED = false;
|
||||
private static final String TAG = "UsageStats";
|
||||
|
||||
// Current on-disk Parcel version
|
||||
@ -404,11 +405,11 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
||||
new Thread("UsageStatsService_DiskWriter") {
|
||||
public void run() {
|
||||
try {
|
||||
Slog.d(TAG, "Disk writer thread starting.");
|
||||
if (localLOGV) Slog.d(TAG, "Disk writer thread starting.");
|
||||
writeStatsToFile(true);
|
||||
} finally {
|
||||
mUnforcedDiskWriteRunning.set(false);
|
||||
Slog.d(TAG, "Disk writer thread ending.");
|
||||
if (localLOGV) Slog.d(TAG, "Disk writer thread ending.");
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
@ -458,7 +459,7 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
||||
}
|
||||
}
|
||||
}
|
||||
Slog.d(TAG, "Dumped usage stats.");
|
||||
if (localLOGV) Slog.d(TAG, "Dumped usage stats.");
|
||||
}
|
||||
|
||||
private void writeStatsFLOCK(File file) throws IOException {
|
||||
@ -493,7 +494,7 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
Slog.w(TAG, "Writing usage stats before shutdown...");
|
||||
Slog.i(TAG, "Writing usage stats before shutdown...");
|
||||
writeStatsToFile(true);
|
||||
}
|
||||
|
||||
@ -520,7 +521,7 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
||||
if (mLastResumedPkg != null) {
|
||||
// We last resumed some other package... just pause it now
|
||||
// to recover.
|
||||
Slog.i(TAG, "Unexpected resume of " + pkgName
|
||||
if (REPORT_UNEXPECTED) Slog.i(TAG, "Unexpected resume of " + pkgName
|
||||
+ " while already resumed in " + mLastResumedPkg);
|
||||
PkgUsageStatsExtended pus = mStats.get(mLastResumedPkg);
|
||||
if (pus != null) {
|
||||
@ -559,7 +560,7 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
||||
return;
|
||||
}
|
||||
if (!mIsResumed) {
|
||||
Slog.i(TAG, "Something wrong here, didn't expect "
|
||||
if (REPORT_UNEXPECTED) Slog.i(TAG, "Something wrong here, didn't expect "
|
||||
+ pkgName + " to be paused");
|
||||
return;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ import java.util.ArrayList;
|
||||
*
|
||||
*/
|
||||
public abstract class DataConnectionTracker extends Handler {
|
||||
protected static final boolean DBG = true;
|
||||
protected static final boolean DBG = false;
|
||||
protected final String LOG_TAG = "DataConnectionTracker";
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user