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()) {
|
while (i.hasNext()) {
|
||||||
ProviderInfo cpi = i.next();
|
ProviderInfo cpi = i.next();
|
||||||
StringBuilder buf = new StringBuilder(128);
|
StringBuilder buf = new StringBuilder(128);
|
||||||
buf.append("Publishing provider ");
|
buf.append("Pub ");
|
||||||
buf.append(cpi.authority);
|
buf.append(cpi.authority);
|
||||||
buf.append(": ");
|
buf.append(": ");
|
||||||
buf.append(cpi.name);
|
buf.append(cpi.name);
|
||||||
|
@ -1730,6 +1730,11 @@ public class PackageParser {
|
|||||||
|
|
||||||
XmlUtils.skipCurrentTag(parser);
|
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 {
|
} else {
|
||||||
if (!RIGID_PARSER) {
|
if (!RIGID_PARSER) {
|
||||||
Log.w(TAG, "Unknown element under <application>: " + tagName
|
Log.w(TAG, "Unknown element under <application>: " + tagName
|
||||||
|
@ -45,7 +45,7 @@ import android.text.TextUtils;
|
|||||||
public class MobileDataStateTracker implements NetworkStateTracker {
|
public class MobileDataStateTracker implements NetworkStateTracker {
|
||||||
|
|
||||||
private static final String TAG = "MobileDataStateTracker";
|
private static final String TAG = "MobileDataStateTracker";
|
||||||
private static final boolean DBG = true;
|
private static final boolean DBG = false;
|
||||||
|
|
||||||
private Phone.DataState mMobileDataState;
|
private Phone.DataState mMobileDataState;
|
||||||
private ITelephony mPhoneService;
|
private ITelephony mPhoneService;
|
||||||
|
@ -71,20 +71,6 @@
|
|||||||
<item>@drawable/indicator_code_lock_point_area_default</item>
|
<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_green</item>
|
||||||
<item>@drawable/indicator_code_lock_point_area_red</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>
|
</array>
|
||||||
|
|
||||||
<!-- Do not translate. These are all of the color state list resources that should be
|
<!-- 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 {
|
public class ConnectivityService extends IConnectivityManager.Stub {
|
||||||
|
|
||||||
private static final boolean DBG = true;
|
private static final boolean DBG = false;
|
||||||
private static final String TAG = "ConnectivityService";
|
private static final String TAG = "ConnectivityService";
|
||||||
|
|
||||||
// how long to wait before switching back to a radio's default network
|
// 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.File;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@ -605,6 +606,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
Slog.w(TAG, "failed parsing " + file + " " + e);
|
Slog.w(TAG, "failed parsing " + file + " " + e);
|
||||||
} catch (XmlPullParserException e) {
|
} catch (XmlPullParserException e) {
|
||||||
Slog.w(TAG, "failed parsing " + file + " " + 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) {
|
} catch (IOException e) {
|
||||||
Slog.w(TAG, "failed parsing " + file + " " + e);
|
Slog.w(TAG, "failed parsing " + file + " " + e);
|
||||||
} catch (IndexOutOfBoundsException e) {
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
@ -951,10 +951,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateStatusIcon(IBinder token, String packageName, int iconId) {
|
public void updateStatusIcon(IBinder token, String packageName, int iconId) {
|
||||||
|
int uid = Binder.getCallingUid();
|
||||||
long ident = Binder.clearCallingIdentity();
|
long ident = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
if (token == null || mCurToken != token) {
|
if (token == null || mCurToken != token) {
|
||||||
Slog.w(TAG, "Ignoring setInputMethod of token: " + token);
|
Slog.w(TAG, "Ignoring setInputMethod of uid " + uid + " token: " + token);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1048,6 +1049,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
|
|
||||||
public boolean showSoftInput(IInputMethodClient client, int flags,
|
public boolean showSoftInput(IInputMethodClient client, int flags,
|
||||||
ResultReceiver resultReceiver) {
|
ResultReceiver resultReceiver) {
|
||||||
|
int uid = Binder.getCallingUid();
|
||||||
long ident = Binder.clearCallingIdentity();
|
long ident = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
synchronized (mMethodMap) {
|
synchronized (mMethodMap) {
|
||||||
@ -1058,7 +1060,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
// focus in the window manager, to allow this call to
|
// focus in the window manager, to allow this call to
|
||||||
// be made before input is started in it.
|
// be made before input is started in it.
|
||||||
if (!mIWindowManager.inputMethodClientHasFocus(client)) {
|
if (!mIWindowManager.inputMethodClientHasFocus(client)) {
|
||||||
Slog.w(TAG, "Ignoring showSoftInput of: " + client);
|
Slog.w(TAG, "Ignoring showSoftInput of uid " + uid + ": " + client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@ -1112,6 +1114,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
|
|
||||||
public boolean hideSoftInput(IInputMethodClient client, int flags,
|
public boolean hideSoftInput(IInputMethodClient client, int flags,
|
||||||
ResultReceiver resultReceiver) {
|
ResultReceiver resultReceiver) {
|
||||||
|
int uid = Binder.getCallingUid();
|
||||||
long ident = Binder.clearCallingIdentity();
|
long ident = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
synchronized (mMethodMap) {
|
synchronized (mMethodMap) {
|
||||||
@ -1122,7 +1125,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
// focus in the window manager, to allow this call to
|
// focus in the window manager, to allow this call to
|
||||||
// be made before input is started in it.
|
// be made before input is started in it.
|
||||||
if (!mIWindowManager.inputMethodClientHasFocus(client)) {
|
if (!mIWindowManager.inputMethodClientHasFocus(client)) {
|
||||||
Slog.w(TAG, "Ignoring hideSoftInput of: " + client);
|
if (DEBUG) Slog.w(TAG, "Ignoring hideSoftInput of uid "
|
||||||
|
+ uid + ": " + client);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@ -1257,7 +1261,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
synchronized (mMethodMap) {
|
synchronized (mMethodMap) {
|
||||||
if (mCurClient == null || client == null
|
if (mCurClient == null || client == null
|
||||||
|| mCurClient.client.asBinder() != client.asBinder()) {
|
|| 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);
|
mHandler.sendEmptyMessage(MSG_SHOW_IM_PICKER);
|
||||||
@ -1290,7 +1295,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
+ android.Manifest.permission.WRITE_SECURE_SETTINGS);
|
+ android.Manifest.permission.WRITE_SECURE_SETTINGS);
|
||||||
}
|
}
|
||||||
} else if (mCurToken != token) {
|
} else if (mCurToken != token) {
|
||||||
Slog.w(TAG, "Ignoring setInputMethod of token: " + token);
|
Slog.w(TAG, "Ignoring setInputMethod of uid " + Binder.getCallingUid()
|
||||||
|
+ " token: " + token);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1306,7 +1312,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
public void hideMySoftInput(IBinder token, int flags) {
|
public void hideMySoftInput(IBinder token, int flags) {
|
||||||
synchronized (mMethodMap) {
|
synchronized (mMethodMap) {
|
||||||
if (token == null || mCurToken != token) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
long ident = Binder.clearCallingIdentity();
|
long ident = Binder.clearCallingIdentity();
|
||||||
@ -1321,7 +1328,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
|
|||||||
public void showMySoftInput(IBinder token, int flags) {
|
public void showMySoftInput(IBinder token, int flags) {
|
||||||
synchronized (mMethodMap) {
|
synchronized (mMethodMap) {
|
||||||
if (token == null || mCurToken != token) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
long ident = Binder.clearCallingIdentity();
|
long ident = Binder.clearCallingIdentity();
|
||||||
|
@ -28,6 +28,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.util.PrintWriterPrinter;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.util.LogPrinter;
|
import android.util.LogPrinter;
|
||||||
import android.util.Printer;
|
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,
|
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 eprefix = prefix + " ";
|
||||||
String fprefix = prefix + " ";
|
String fprefix = prefix + " ";
|
||||||
boolean printedSomething = false;
|
boolean printedSomething = false;
|
||||||
|
Printer printer = null;
|
||||||
for (Map.Entry<String, ArrayList<F>> e : map.entrySet()) {
|
for (Map.Entry<String, ArrayList<F>> e : map.entrySet()) {
|
||||||
ArrayList<F> a = e.getValue();
|
ArrayList<F> a = e.getValue();
|
||||||
final int N = a.size();
|
final int N = a.size();
|
||||||
@ -115,37 +118,44 @@ public class IntentResolver<F extends IntentFilter, R extends Object> {
|
|||||||
}
|
}
|
||||||
printedSomething = true;
|
printedSomething = true;
|
||||||
dumpFilter(out, fprefix, filter);
|
dumpFilter(out, fprefix, filter);
|
||||||
|
if (printFilter) {
|
||||||
|
if (printer == null) {
|
||||||
|
printer = new PrintWriterPrinter(out);
|
||||||
|
}
|
||||||
|
filter.dump(printer, fprefix + " ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return printedSomething;
|
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 innerPrefix = prefix + " ";
|
||||||
String sepPrefix = "\n" + prefix;
|
String sepPrefix = "\n" + prefix;
|
||||||
String curPrefix = title + "\n" + prefix;
|
String curPrefix = title + "\n" + prefix;
|
||||||
if (dumpMap(out, curPrefix, "Full MIME Types:", innerPrefix,
|
if (dumpMap(out, curPrefix, "Full MIME Types:", innerPrefix,
|
||||||
mTypeToFilter, packageName)) {
|
mTypeToFilter, packageName, printFilter)) {
|
||||||
curPrefix = sepPrefix;
|
curPrefix = sepPrefix;
|
||||||
}
|
}
|
||||||
if (dumpMap(out, curPrefix, "Base MIME Types:", innerPrefix,
|
if (dumpMap(out, curPrefix, "Base MIME Types:", innerPrefix,
|
||||||
mBaseTypeToFilter, packageName)) {
|
mBaseTypeToFilter, packageName, printFilter)) {
|
||||||
curPrefix = sepPrefix;
|
curPrefix = sepPrefix;
|
||||||
}
|
}
|
||||||
if (dumpMap(out, curPrefix, "Wild MIME Types:", innerPrefix,
|
if (dumpMap(out, curPrefix, "Wild MIME Types:", innerPrefix,
|
||||||
mWildTypeToFilter, packageName)) {
|
mWildTypeToFilter, packageName, printFilter)) {
|
||||||
curPrefix = sepPrefix;
|
curPrefix = sepPrefix;
|
||||||
}
|
}
|
||||||
if (dumpMap(out, curPrefix, "Schemes:", innerPrefix,
|
if (dumpMap(out, curPrefix, "Schemes:", innerPrefix,
|
||||||
mSchemeToFilter, packageName)) {
|
mSchemeToFilter, packageName, printFilter)) {
|
||||||
curPrefix = sepPrefix;
|
curPrefix = sepPrefix;
|
||||||
}
|
}
|
||||||
if (dumpMap(out, curPrefix, "Non-Data Actions:", innerPrefix,
|
if (dumpMap(out, curPrefix, "Non-Data Actions:", innerPrefix,
|
||||||
mActionToFilter, packageName)) {
|
mActionToFilter, packageName, printFilter)) {
|
||||||
curPrefix = sepPrefix;
|
curPrefix = sepPrefix;
|
||||||
}
|
}
|
||||||
if (dumpMap(out, curPrefix, "MIME Typed Actions:", innerPrefix,
|
if (dumpMap(out, curPrefix, "MIME Typed Actions:", innerPrefix,
|
||||||
mTypedActionToFilter, packageName)) {
|
mTypedActionToFilter, packageName, printFilter)) {
|
||||||
curPrefix = sepPrefix;
|
curPrefix = sepPrefix;
|
||||||
}
|
}
|
||||||
return curPrefix == sepPrefix;
|
return curPrefix == sepPrefix;
|
||||||
|
@ -55,7 +55,7 @@ import java.util.concurrent.CountDownLatch;
|
|||||||
class NetworkManagementService extends INetworkManagementService.Stub {
|
class NetworkManagementService extends INetworkManagementService.Stub {
|
||||||
|
|
||||||
private static final String TAG = "NetworkManagmentService";
|
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";
|
private static final String NETD_TAG = "NetdConnector";
|
||||||
|
|
||||||
class NetdResponseCode {
|
class NetdResponseCode {
|
||||||
|
@ -1102,27 +1102,6 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
final File permFile = new File(Environment.getRootDirectory(),
|
final File permFile = new File(Environment.getRootDirectory(),
|
||||||
"etc/permissions/platform.xml");
|
"etc/permissions/platform.xml");
|
||||||
readPermissionsFromXml(permFile);
|
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) {
|
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
|
// The system package has been updated and the code path does not match
|
||||||
// Ignore entry. Skip it.
|
// Ignore entry. Skip it.
|
||||||
Log.i(TAG, "Package " + ps.name + " at " + scanFile
|
Log.i(TAG, "Package " + ps.name + " at " + scanFile
|
||||||
+ "ignored: updated version " + ps.versionCode
|
+ " ignored: updated version " + ps.versionCode
|
||||||
+ " better than this " + pkg.mVersionCode);
|
+ " better than this " + pkg.mVersionCode);
|
||||||
mLastScanError = PackageManager.INSTALL_FAILED_DUPLICATE_PACKAGE;
|
mLastScanError = PackageManager.INSTALL_FAILED_DUPLICATE_PACKAGE;
|
||||||
return null;
|
return null;
|
||||||
@ -6866,7 +6845,18 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
return;
|
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;
|
String packageName = null;
|
||||||
|
boolean showFilters = false;
|
||||||
|
|
||||||
int opti = 0;
|
int opti = 0;
|
||||||
while (opti < args.length) {
|
while (opti < args.length) {
|
||||||
@ -6879,10 +6869,22 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
// Right now we only know how to print all.
|
// Right now we only know how to print all.
|
||||||
} else if ("-h".equals(opt)) {
|
} else if ("-h".equals(opt)) {
|
||||||
pw.println("Package manager dump options:");
|
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(" 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;
|
return;
|
||||||
|
} else if ("-f".equals(opt)) {
|
||||||
|
showFilters = true;
|
||||||
} else {
|
} else {
|
||||||
pw.println("Unknown argument: " + opt + "; use -h for help");
|
pw.println("Unknown argument: " + opt + "; use -h for help");
|
||||||
}
|
}
|
||||||
@ -6895,32 +6897,87 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
// Is this a package name?
|
// Is this a package name?
|
||||||
if ("android".equals(cmd) || cmd.contains(".")) {
|
if ("android".equals(cmd) || cmd.contains(".")) {
|
||||||
packageName = cmd;
|
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;
|
boolean printedTitle = false;
|
||||||
|
|
||||||
synchronized (mPackages) {
|
synchronized (mPackages) {
|
||||||
if (mActivities.dump(pw, "Activity Resolver Table:", " ", packageName)) {
|
if ((dumpStar || dumpLibs) && packageName == null) {
|
||||||
|
if (printedTitle) pw.println(" ");
|
||||||
printedTitle = true;
|
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 (mReceivers.dump(pw, printedTitle
|
|
||||||
? "\nReceiver Resolver Table:" : "Receiver Resolver Table:",
|
if ((dumpStar || dumpFeatures) && packageName == null) {
|
||||||
" ", packageName)) {
|
if (printedTitle) pw.println(" ");
|
||||||
printedTitle = true;
|
printedTitle = true;
|
||||||
|
pw.println("Features:");
|
||||||
|
Iterator<String> it = mAvailableFeatures.keySet().iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
String name = it.next();
|
||||||
|
pw.print(" ");
|
||||||
|
pw.println(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mServices.dump(pw, printedTitle
|
|
||||||
? "\nService Resolver Table:" : "Service Resolver Table:",
|
if (dumpStar || dumpResolvers) {
|
||||||
" ", packageName)) {
|
if (mActivities.dump(pw, printedTitle
|
||||||
printedTitle = true;
|
? "\nActivity Resolver Table:" : "Activity Resolver Table:",
|
||||||
}
|
" ", packageName, showFilters)) {
|
||||||
if (mSettings.mPreferredActivities.dump(pw, printedTitle
|
printedTitle = true;
|
||||||
? "\nPreferred Activities:" : "Preferred Activities:",
|
}
|
||||||
" ", packageName)) {
|
if (mReceivers.dump(pw, printedTitle
|
||||||
printedTitle = true;
|
? "\nReceiver Resolver Table:" : "Receiver Resolver Table:",
|
||||||
|
" ", packageName, showFilters)) {
|
||||||
|
printedTitle = true;
|
||||||
|
}
|
||||||
|
if (mServices.dump(pw, printedTitle
|
||||||
|
? "\nService Resolver Table:" : "Service Resolver Table:",
|
||||||
|
" ", packageName, showFilters)) {
|
||||||
|
printedTitle = true;
|
||||||
|
}
|
||||||
|
if (mSettings.mPreferredActivities.dump(pw, printedTitle
|
||||||
|
? "\nPreferred Activities:" : "Preferred Activities:",
|
||||||
|
" ", packageName, showFilters)) {
|
||||||
|
printedTitle = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean printedSomething = false;
|
boolean printedSomething = false;
|
||||||
{
|
if (dumpStar || dumpPermissions) {
|
||||||
for (BasePermission p : mSettings.mPermissions.values()) {
|
for (BasePermission p : mSettings.mPermissions.values()) {
|
||||||
if (packageName != null && !packageName.equals(p.sourcePackage)) {
|
if (packageName != null && !packageName.equals(p.sourcePackage)) {
|
||||||
continue;
|
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;
|
printedSomething = false;
|
||||||
SharedUserSetting packageSharedUser = null;
|
SharedUserSetting packageSharedUser = null;
|
||||||
{
|
if (dumpStar || dumpPackages) {
|
||||||
for (PackageSetting ps : mSettings.mPackages.values()) {
|
for (PackageSetting ps : mSettings.mPackages.values()) {
|
||||||
if (packageName != null && !packageName.equals(ps.realName)
|
if (packageName != null && !packageName.equals(ps.realName)
|
||||||
&& !packageName.equals(ps.name)) {
|
&& !packageName.equals(ps.name)) {
|
||||||
@ -7052,52 +7127,54 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
printedSomething = false;
|
printedSomething = false;
|
||||||
if (mSettings.mRenamedPackages.size() > 0) {
|
if (dumpStar || dumpPackages) {
|
||||||
for (HashMap.Entry<String, String> e
|
if (mSettings.mRenamedPackages.size() > 0) {
|
||||||
: mSettings.mRenamedPackages.entrySet()) {
|
for (HashMap.Entry<String, String> e
|
||||||
if (packageName != null && !packageName.equals(e.getKey())
|
: mSettings.mRenamedPackages.entrySet()) {
|
||||||
&& !packageName.equals(e.getValue())) {
|
if (packageName != null && !packageName.equals(e.getKey())
|
||||||
continue;
|
&& !packageName.equals(e.getValue())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!printedSomething) {
|
||||||
|
if (printedTitle) pw.println(" ");
|
||||||
|
pw.println("Renamed packages:");
|
||||||
|
printedSomething = true;
|
||||||
|
printedTitle = true;
|
||||||
|
}
|
||||||
|
pw.print(" "); pw.print(e.getKey()); pw.print(" -> ");
|
||||||
|
pw.println(e.getValue());
|
||||||
}
|
}
|
||||||
if (!printedSomething) {
|
}
|
||||||
if (printedTitle) pw.println(" ");
|
printedSomething = false;
|
||||||
pw.println("Renamed packages:");
|
if (mSettings.mDisabledSysPackages.size() > 0) {
|
||||||
printedSomething = true;
|
for (PackageSetting ps : mSettings.mDisabledSysPackages.values()) {
|
||||||
printedTitle = true;
|
if (packageName != null && !packageName.equals(ps.realName)
|
||||||
|
&& !packageName.equals(ps.name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!printedSomething) {
|
||||||
|
if (printedTitle) pw.println(" ");
|
||||||
|
pw.println("Hidden system packages:");
|
||||||
|
printedSomething = true;
|
||||||
|
printedTitle = true;
|
||||||
|
}
|
||||||
|
pw.print(" Package [");
|
||||||
|
pw.print(ps.realName != null ? ps.realName : ps.name);
|
||||||
|
pw.print("] (");
|
||||||
|
pw.print(Integer.toHexString(System.identityHashCode(ps)));
|
||||||
|
pw.println("):");
|
||||||
|
if (ps.realName != null) {
|
||||||
|
pw.print(" compat name="); pw.println(ps.name);
|
||||||
|
}
|
||||||
|
pw.print(" userId="); pw.println(ps.userId);
|
||||||
|
pw.print(" sharedUser="); pw.println(ps.sharedUser);
|
||||||
|
pw.print(" codePath="); pw.println(ps.codePathString);
|
||||||
|
pw.print(" resourcePath="); pw.println(ps.resourcePathString);
|
||||||
}
|
}
|
||||||
pw.print(" "); pw.print(e.getKey()); pw.print(" -> ");
|
|
||||||
pw.println(e.getValue());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printedSomething = false;
|
printedSomething = false;
|
||||||
if (mSettings.mDisabledSysPackages.size() > 0) {
|
if (dumpStar || dumpSharedUsers) {
|
||||||
for (PackageSetting ps : mSettings.mDisabledSysPackages.values()) {
|
|
||||||
if (packageName != null && !packageName.equals(ps.realName)
|
|
||||||
&& !packageName.equals(ps.name)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!printedSomething) {
|
|
||||||
if (printedTitle) pw.println(" ");
|
|
||||||
pw.println("Hidden system packages:");
|
|
||||||
printedSomething = true;
|
|
||||||
printedTitle = true;
|
|
||||||
}
|
|
||||||
pw.print(" Package [");
|
|
||||||
pw.print(ps.realName != null ? ps.realName : ps.name);
|
|
||||||
pw.print("] (");
|
|
||||||
pw.print(Integer.toHexString(System.identityHashCode(ps)));
|
|
||||||
pw.println("):");
|
|
||||||
if (ps.realName != null) {
|
|
||||||
pw.print(" compat name="); pw.println(ps.name);
|
|
||||||
}
|
|
||||||
pw.print(" userId="); pw.println(ps.userId);
|
|
||||||
pw.print(" sharedUser="); pw.println(ps.sharedUser);
|
|
||||||
pw.print(" codePath="); pw.println(ps.codePathString);
|
|
||||||
pw.print(" resourcePath="); pw.println(ps.resourcePathString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printedSomething = false;
|
|
||||||
{
|
|
||||||
for (SharedUserSetting su : mSettings.mSharedUsers.values()) {
|
for (SharedUserSetting su : mSettings.mSharedUsers.values()) {
|
||||||
if (packageName != null && su != packageSharedUser) {
|
if (packageName != null && su != packageSharedUser) {
|
||||||
continue;
|
continue;
|
||||||
@ -7120,11 +7197,11 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packageName == null) {
|
if ((dumpStar || dumpMessages) && packageName == null) {
|
||||||
if (printedTitle) pw.println(" ");
|
if (printedTitle) pw.println(" ");
|
||||||
printedTitle = true;
|
printedTitle = true;
|
||||||
pw.println("Settings parse messages:");
|
pw.println("Settings parse messages:");
|
||||||
pw.println(mSettings.mReadMessages.toString());
|
pw.print(mSettings.mReadMessages.toString());
|
||||||
|
|
||||||
pw.println(" ");
|
pw.println(" ");
|
||||||
pw.println("Package warning messages:");
|
pw.println("Package warning messages:");
|
||||||
@ -7135,29 +7212,12 @@ class PackageManagerService extends IPackageManager.Stub {
|
|||||||
int avail = in.available();
|
int avail = in.available();
|
||||||
byte[] data = new byte[avail];
|
byte[] data = new byte[avail];
|
||||||
in.read(data);
|
in.read(data);
|
||||||
pw.println(new String(data));
|
pw.print(new String(data));
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
} catch (IOException 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 {
|
static final class BasePermission {
|
||||||
|
@ -113,9 +113,15 @@ import android.view.View;
|
|||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.view.WindowManagerPolicy;
|
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.File;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@ -6123,6 +6129,76 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
return mSystemReady;
|
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) {
|
public void systemReady(final Runnable goingCallback) {
|
||||||
// In the simulator, startRunning will never have been called, which
|
// In the simulator, startRunning will never have been called, which
|
||||||
// normally sets a few crucial variables. Do it here instead.
|
// 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);
|
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++) {
|
for (int i=0; i<ris.size(); i++) {
|
||||||
ActivityInfo ai = ris.get(i).activityInfo;
|
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;
|
IIntentReceiver finisher = null;
|
||||||
if (i == ris.size()-1) {
|
if (i == ris.size()-1) {
|
||||||
finisher = new IIntentReceiver.Stub() {
|
finisher = new IIntentReceiver.Stub() {
|
||||||
@ -6174,6 +6265,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
synchronized (ActivityManagerService.this) {
|
synchronized (ActivityManagerService.this) {
|
||||||
mDidUpdate = true;
|
mDidUpdate = true;
|
||||||
}
|
}
|
||||||
|
writeLastDonePreBootReceivers(doneReceivers);
|
||||||
systemReady(goingCallback);
|
systemReady(goingCallback);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -6213,19 +6305,19 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (procsToKill != null) {
|
synchronized(this) {
|
||||||
synchronized(this) {
|
if (procsToKill != null) {
|
||||||
for (int i=procsToKill.size()-1; i>=0; i--) {
|
for (int i=procsToKill.size()-1; i>=0; i--) {
|
||||||
ProcessRecord proc = procsToKill.get(i);
|
ProcessRecord proc = procsToKill.get(i);
|
||||||
Slog.i(TAG, "Removing system update proc: " + proc);
|
Slog.i(TAG, "Removing system update proc: " + proc);
|
||||||
removeProcessLocked(proc, true);
|
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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");
|
Slog.i(TAG, "System now ready");
|
||||||
@ -7741,7 +7833,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
|||||||
|
|
||||||
pw.println(" ");
|
pw.println(" ");
|
||||||
pw.println("Receiver Resolver Table:");
|
pw.println("Receiver Resolver Table:");
|
||||||
mReceiverResolver.dump(pw, null, " ", null);
|
mReceiverResolver.dump(pw, null, " ", null, false);
|
||||||
needSep = true;
|
needSep = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,10 +444,11 @@ class ActivityRecord extends IApplicationToken.Stub {
|
|||||||
sb.append(shortComponentName);
|
sb.append(shortComponentName);
|
||||||
sb.append(": ");
|
sb.append(": ");
|
||||||
TimeUtils.formatDuration(thisTime, sb);
|
TimeUtils.formatDuration(thisTime, sb);
|
||||||
sb.append(" (total ");
|
if (thisTime != totalTime) {
|
||||||
TimeUtils.formatDuration(totalTime, sb);
|
sb.append(" (total ");
|
||||||
sb.append(totalTime);
|
TimeUtils.formatDuration(totalTime, sb);
|
||||||
sb.append(")");
|
sb.append(")");
|
||||||
|
}
|
||||||
Log.i(ActivityManagerService.TAG, sb.toString());
|
Log.i(ActivityManagerService.TAG, sb.toString());
|
||||||
}
|
}
|
||||||
stack.reportActivityLaunchedLocked(false, this, thisTime, totalTime);
|
stack.reportActivityLaunchedLocked(false, this, thisTime, totalTime);
|
||||||
|
@ -1881,7 +1881,7 @@ public class ActivityStack {
|
|||||||
String resultWho, int requestCode,
|
String resultWho, int requestCode,
|
||||||
int callingPid, int callingUid, boolean onlyIfNeeded,
|
int callingPid, int callingUid, boolean onlyIfNeeded,
|
||||||
boolean componentSpecified) {
|
boolean componentSpecified) {
|
||||||
Slog.i(TAG, "Starting activity: " + intent);
|
Slog.i(TAG, "Starting: " + intent);
|
||||||
|
|
||||||
ActivityRecord sourceRecord = null;
|
ActivityRecord sourceRecord = null;
|
||||||
ActivityRecord resultRecord = null;
|
ActivityRecord resultRecord = null;
|
||||||
|
@ -57,6 +57,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||||||
public final class UsageStatsService extends IUsageStats.Stub {
|
public final class UsageStatsService extends IUsageStats.Stub {
|
||||||
public static final String SERVICE_NAME = "usagestats";
|
public static final String SERVICE_NAME = "usagestats";
|
||||||
private static final boolean localLOGV = false;
|
private static final boolean localLOGV = false;
|
||||||
|
private static final boolean REPORT_UNEXPECTED = false;
|
||||||
private static final String TAG = "UsageStats";
|
private static final String TAG = "UsageStats";
|
||||||
|
|
||||||
// Current on-disk Parcel version
|
// Current on-disk Parcel version
|
||||||
@ -404,11 +405,11 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
|||||||
new Thread("UsageStatsService_DiskWriter") {
|
new Thread("UsageStatsService_DiskWriter") {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Slog.d(TAG, "Disk writer thread starting.");
|
if (localLOGV) Slog.d(TAG, "Disk writer thread starting.");
|
||||||
writeStatsToFile(true);
|
writeStatsToFile(true);
|
||||||
} finally {
|
} finally {
|
||||||
mUnforcedDiskWriteRunning.set(false);
|
mUnforcedDiskWriteRunning.set(false);
|
||||||
Slog.d(TAG, "Disk writer thread ending.");
|
if (localLOGV) Slog.d(TAG, "Disk writer thread ending.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start();
|
}.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 {
|
private void writeStatsFLOCK(File file) throws IOException {
|
||||||
@ -493,7 +494,7 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
Slog.w(TAG, "Writing usage stats before shutdown...");
|
Slog.i(TAG, "Writing usage stats before shutdown...");
|
||||||
writeStatsToFile(true);
|
writeStatsToFile(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -520,7 +521,7 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
|||||||
if (mLastResumedPkg != null) {
|
if (mLastResumedPkg != null) {
|
||||||
// We last resumed some other package... just pause it now
|
// We last resumed some other package... just pause it now
|
||||||
// to recover.
|
// to recover.
|
||||||
Slog.i(TAG, "Unexpected resume of " + pkgName
|
if (REPORT_UNEXPECTED) Slog.i(TAG, "Unexpected resume of " + pkgName
|
||||||
+ " while already resumed in " + mLastResumedPkg);
|
+ " while already resumed in " + mLastResumedPkg);
|
||||||
PkgUsageStatsExtended pus = mStats.get(mLastResumedPkg);
|
PkgUsageStatsExtended pus = mStats.get(mLastResumedPkg);
|
||||||
if (pus != null) {
|
if (pus != null) {
|
||||||
@ -559,7 +560,7 @@ public final class UsageStatsService extends IUsageStats.Stub {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!mIsResumed) {
|
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");
|
+ pkgName + " to be paused");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ import java.util.ArrayList;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class DataConnectionTracker extends Handler {
|
public abstract class DataConnectionTracker extends Handler {
|
||||||
protected static final boolean DBG = true;
|
protected static final boolean DBG = false;
|
||||||
protected final String LOG_TAG = "DataConnectionTracker";
|
protected final String LOG_TAG = "DataConnectionTracker";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user