summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/ActivityThread.java14
-rw-r--r--core/java/android/app/ContextImpl.java4
-rw-r--r--core/java/android/content/SyncStorageEngine.java61
-rw-r--r--core/java/android/content/pm/RegisteredServicesCache.java53
-rw-r--r--core/java/android/server/search/SearchManagerService.java2
-rw-r--r--core/java/com/android/internal/content/PackageHelper.java2
-rw-r--r--core/res/res/values/arrays.xml6
7 files changed, 81 insertions, 61 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 456d757..d880817 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -4421,12 +4421,14 @@ public final class ActivityThread {
new ArrayList<IActivityManager.ContentProviderHolder>();
for (ProviderInfo cpi : providers) {
- StringBuilder buf = new StringBuilder(128);
- buf.append("Pub ");
- buf.append(cpi.authority);
- buf.append(": ");
- buf.append(cpi.name);
- Log.i(TAG, buf.toString());
+ if (DEBUG_PROVIDER) {
+ StringBuilder buf = new StringBuilder(128);
+ buf.append("Pub ");
+ buf.append(cpi.authority);
+ buf.append(": ");
+ buf.append(cpi.name);
+ Log.i(TAG, buf.toString());
+ }
IActivityManager.ContentProviderHolder cph = installProvider(context, null, cpi,
false /*noisy*/, true /*noReleaseNeeded*/, true /*stable*/);
if (cph != null) {
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 95b6bed..f895ccc 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -168,7 +168,7 @@ class ReceiverRestrictedContext extends ContextWrapper {
* context object for Activity and other application components.
*/
class ContextImpl extends Context {
- private final static String TAG = "ApplicationContext";
+ private final static String TAG = "ContextImpl";
private final static boolean DEBUG = false;
private static final HashMap<String, SharedPreferencesImpl> sSharedPrefs =
@@ -1715,7 +1715,7 @@ class ContextImpl extends Context {
private void warnIfCallingFromSystemProcess() {
if (Process.myUid() == Process.SYSTEM_UID) {
Slog.w(TAG, "Calling a method in the system process without a qualified user: "
- + Debug.getCallers(3));
+ + Debug.getCallers(5));
}
}
diff --git a/core/java/android/content/SyncStorageEngine.java b/core/java/android/content/SyncStorageEngine.java
index bdc5a3f..1ecab09 100644
--- a/core/java/android/content/SyncStorageEngine.java
+++ b/core/java/android/content/SyncStorageEngine.java
@@ -64,6 +64,7 @@ import java.util.List;
public class SyncStorageEngine extends Handler {
private static final String TAG = "SyncManager";
+ private static final boolean DEBUG = false;
private static final boolean DEBUG_FILE = false;
private static final String XML_ATTR_NEXT_AUTHORITY_ID = "nextAuthorityId";
@@ -443,7 +444,7 @@ public class SyncStorageEngine extends Handler {
mChangeListeners.finishBroadcast();
}
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "reportChange " + which + " to: " + reports);
}
@@ -484,13 +485,17 @@ public class SyncStorageEngine extends Handler {
public void setSyncAutomatically(Account account, int userId, String providerName,
boolean sync) {
- Log.d(TAG, "setSyncAutomatically: " + /* account + */" provider " + providerName
- + ", user " + userId + " -> " + sync);
+ if (DEBUG) {
+ Log.d(TAG, "setSyncAutomatically: " + /* account + */" provider " + providerName
+ + ", user " + userId + " -> " + sync);
+ }
synchronized (mAuthorities) {
AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
false);
if (authority.enabled == sync) {
- Log.d(TAG, "setSyncAutomatically: already set to " + sync + ", doing nothing");
+ if (DEBUG) {
+ Log.d(TAG, "setSyncAutomatically: already set to " + sync + ", doing nothing");
+ }
return;
}
authority.enabled = sync;
@@ -532,13 +537,17 @@ public class SyncStorageEngine extends Handler {
} else if (syncable < -1) {
syncable = -1;
}
- Log.d(TAG, "setIsSyncable: " + account + ", provider " + providerName
- + ", user " + userId + " -> " + syncable);
+ if (DEBUG) {
+ Log.d(TAG, "setIsSyncable: " + account + ", provider " + providerName
+ + ", user " + userId + " -> " + syncable);
+ }
synchronized (mAuthorities) {
AuthorityInfo authority = getOrCreateAuthorityLocked(account, userId, providerName, -1,
false);
if (authority.syncable == syncable) {
- Log.d(TAG, "setIsSyncable: already set to " + syncable + ", doing nothing");
+ if (DEBUG) {
+ Log.d(TAG, "setIsSyncable: already set to " + syncable + ", doing nothing");
+ }
return;
}
authority.syncable = syncable;
@@ -564,7 +573,7 @@ public class SyncStorageEngine extends Handler {
public void setBackoff(Account account, int userId, String providerName,
long nextSyncTime, long nextDelay) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "setBackoff: " + account + ", provider " + providerName
+ ", user " + userId
+ " -> nextSyncTime " + nextSyncTime + ", nextDelay " + nextDelay);
@@ -615,7 +624,7 @@ public class SyncStorageEngine extends Handler {
for (AuthorityInfo authorityInfo : accountInfo.authorities.values()) {
if (authorityInfo.backoffTime != NOT_IN_BACKOFF_MODE
|| authorityInfo.backoffDelay != NOT_IN_BACKOFF_MODE) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "clearAllBackoffs:"
+ " authority:" + authorityInfo.authority
+ " account:" + accountInfo.accountAndUser.account.name
@@ -641,7 +650,7 @@ public class SyncStorageEngine extends Handler {
public void setDelayUntilTime(Account account, int userId, String providerName,
long delayUntil) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "setDelayUntil: " + account + ", provider " + providerName
+ ", user " + userId + " -> delayUntil " + delayUntil);
}
@@ -677,7 +686,7 @@ public class SyncStorageEngine extends Handler {
if (extras == null) {
extras = new Bundle();
}
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "addOrRemovePeriodicSync: " + account + ", user " + userId
+ ", provider " + providerName
+ " -> period " + period + ", extras " + extras);
@@ -833,7 +842,7 @@ public class SyncStorageEngine extends Handler {
public PendingOperation insertIntoPending(PendingOperation op) {
synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "insertIntoPending: account=" + op.account
+ " user=" + op.userId
+ " auth=" + op.authority
@@ -865,7 +874,7 @@ public class SyncStorageEngine extends Handler {
public boolean deleteFromPending(PendingOperation op) {
boolean res = false;
synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "deleteFromPending: account=" + op.account
+ " user=" + op.userId
+ " auth=" + op.authority
@@ -884,7 +893,7 @@ public class SyncStorageEngine extends Handler {
AuthorityInfo authority = getAuthorityLocked(op.account, op.userId, op.authority,
"deleteFromPending");
if (authority != null) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "removing - " + authority);
+ if (DEBUG) Log.v(TAG, "removing - " + authority);
final int N = mPendingOperations.size();
boolean morePending = false;
for (int i=0; i<N; i++) {
@@ -898,7 +907,7 @@ public class SyncStorageEngine extends Handler {
}
if (!morePending) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "no more pending!");
+ if (DEBUG) Log.v(TAG, "no more pending!");
SyncStatusInfo status = getOrCreateSyncStatusLocked(authority.ident);
status.pending = false;
}
@@ -938,7 +947,7 @@ public class SyncStorageEngine extends Handler {
*/
public void doDatabaseCleanup(Account[] accounts, int userId) {
synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) Log.w(TAG, "Updating for new accounts...");
+ if (DEBUG) Log.v(TAG, "Updating for new accounts...");
SparseArray<AuthorityInfo> removing = new SparseArray<AuthorityInfo>();
Iterator<AccountInfo> accIt = mAccounts.values().iterator();
while (accIt.hasNext()) {
@@ -946,8 +955,8 @@ public class SyncStorageEngine extends Handler {
if (!ArrayUtils.contains(accounts, acc.accountAndUser.account)
&& acc.accountAndUser.userId == userId) {
// This account no longer exists...
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.w(TAG, "Account removed: " + acc.accountAndUser);
+ if (DEBUG) {
+ Log.v(TAG, "Account removed: " + acc.accountAndUser);
}
for (AuthorityInfo auth : acc.authorities.values()) {
removing.put(auth.ident, auth);
@@ -993,7 +1002,7 @@ public class SyncStorageEngine extends Handler {
public SyncInfo addActiveSync(SyncManager.ActiveSyncContext activeSyncContext) {
final SyncInfo syncInfo;
synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "setActiveSync: account="
+ activeSyncContext.mSyncOperation.account
+ " auth=" + activeSyncContext.mSyncOperation.authority
@@ -1021,7 +1030,7 @@ public class SyncStorageEngine extends Handler {
*/
public void removeActiveSync(SyncInfo syncInfo, int userId) {
synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "removeActiveSync: account=" + syncInfo.account
+ " user=" + userId
+ " auth=" + syncInfo.authority);
@@ -1046,7 +1055,7 @@ public class SyncStorageEngine extends Handler {
long now, int source, boolean initialization) {
long id;
synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "insertStartSyncEvent: account=" + accountName + "user=" + userId
+ " auth=" + authorityName + " source=" + source);
}
@@ -1068,7 +1077,7 @@ public class SyncStorageEngine extends Handler {
mSyncHistory.remove(mSyncHistory.size()-1);
}
id = item.historyId;
- if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "returning historyId " + id);
+ if (DEBUG) Log.v(TAG, "returning historyId " + id);
}
reportChange(ContentResolver.SYNC_OBSERVER_TYPE_STATUS);
@@ -1096,7 +1105,7 @@ public class SyncStorageEngine extends Handler {
public void stopSyncEvent(long historyId, long elapsedTime, String resultMessage,
long downstreamActivity, long upstreamActivity) {
synchronized (mAuthorities) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "stopSyncEvent: historyId=" + historyId);
}
SyncHistoryItem item = null;
@@ -1358,7 +1367,7 @@ public class SyncStorageEngine extends Handler {
AccountInfo accountInfo = mAccounts.get(au);
if (accountInfo == null) {
if (tag != null) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, tag + ": unknown account " + au);
}
}
@@ -1367,7 +1376,7 @@ public class SyncStorageEngine extends Handler {
AuthorityInfo authority = accountInfo.authorities.get(authorityName);
if (authority == null) {
if (tag != null) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, tag + ": unknown authority " + authorityName);
}
}
@@ -1392,7 +1401,7 @@ public class SyncStorageEngine extends Handler {
mNextAuthorityId++;
doWrite = true;
}
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.v(TAG, "created a new AuthorityInfo for " + accountName
+ ", user " + userId
+ ", provider " + authorityName);
diff --git a/core/java/android/content/pm/RegisteredServicesCache.java b/core/java/android/content/pm/RegisteredServicesCache.java
index a07a865..aaa0917 100644
--- a/core/java/android/content/pm/RegisteredServicesCache.java
+++ b/core/java/android/content/pm/RegisteredServicesCache.java
@@ -69,6 +69,7 @@ import java.util.Map;
*/
public abstract class RegisteredServicesCache<V> {
private static final String TAG = "PackageManager";
+ private static final boolean DEBUG = false;
public final Context mContext;
private final String mInterfaceName;
@@ -195,7 +196,7 @@ public abstract class RegisteredServicesCache<V> {
}
private void notifyListener(final V type, final int userId, final boolean removed) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
Log.d(TAG, "notifyListener: " + type + " is " + (removed ? "removed" : "added"));
}
RegisteredServicesCacheListener<V> listener;
@@ -291,7 +292,9 @@ public abstract class RegisteredServicesCache<V> {
* given {@link UserHandle}.
*/
private void generateServicesMap(int userId) {
- Slog.d(TAG, "generateServicesMap() for " + userId);
+ if (DEBUG) {
+ Slog.d(TAG, "generateServicesMap() for " + userId);
+ }
final PackageManager pm = mContext.getPackageManager();
final ArrayList<ServiceInfo<V>> serviceInfos = new ArrayList<ServiceInfo<V>>();
@@ -322,6 +325,7 @@ public abstract class RegisteredServicesCache<V> {
}
StringBuilder changes = new StringBuilder();
+ boolean changed = false;
for (ServiceInfo<V> info : serviceInfos) {
// four cases:
// - doesn't exist yet
@@ -334,33 +338,41 @@ public abstract class RegisteredServicesCache<V> {
// - add, notify user that it was added
Integer previousUid = user.persistentServices.get(info.type);
if (previousUid == null) {
- changes.append(" New service added: ").append(info).append("\n");
+ if (DEBUG) {
+ changes.append(" New service added: ").append(info).append("\n");
+ }
+ changed = true;
user.services.put(info.type, info);
user.persistentServices.put(info.type, info.uid);
if (!(mPersistentServicesFileDidNotExist && firstScan)) {
notifyListener(info.type, userId, false /* removed */);
}
} else if (previousUid == info.uid) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
changes.append(" Existing service (nop): ").append(info).append("\n");
}
user.services.put(info.type, info);
} else if (inSystemImage(info.uid)
|| !containsTypeAndUid(serviceInfos, info.type, previousUid)) {
- if (inSystemImage(info.uid)) {
- changes.append(" System service replacing existing: ").append(info)
- .append("\n");
- } else {
- changes.append(" Existing service replacing a removed service: ")
- .append(info).append("\n");
+ if (DEBUG) {
+ if (inSystemImage(info.uid)) {
+ changes.append(" System service replacing existing: ").append(info)
+ .append("\n");
+ } else {
+ changes.append(" Existing service replacing a removed service: ")
+ .append(info).append("\n");
+ }
}
+ changed = true;
user.services.put(info.type, info);
user.persistentServices.put(info.type, info.uid);
notifyListener(info.type, userId, false /* removed */);
} else {
// ignore
- changes.append(" Existing service with new uid ignored: ").append(info)
- .append("\n");
+ if (DEBUG) {
+ changes.append(" Existing service with new uid ignored: ").append(info)
+ .append("\n");
+ }
}
}
@@ -371,22 +383,25 @@ public abstract class RegisteredServicesCache<V> {
}
}
for (V v1 : toBeRemoved) {
+ if (DEBUG) {
+ changes.append(" Service removed: ").append(v1).append("\n");
+ }
+ changed = true;
user.persistentServices.remove(v1);
- changes.append(" Service removed: ").append(v1).append("\n");
notifyListener(v1, userId, true /* removed */);
}
- if (changes.length() > 0) {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ if (DEBUG) {
+ if (changes.length() > 0) {
Log.d(TAG, "generateServicesMap(" + mInterfaceName + "): " +
serviceInfos.size() + " services:\n" + changes);
- }
- writePersistentServicesLocked();
- } else {
- if (Log.isLoggable(TAG, Log.VERBOSE)) {
+ } else {
Log.d(TAG, "generateServicesMap(" + mInterfaceName + "): " +
serviceInfos.size() + " services unchanged");
}
}
+ if (changed) {
+ writePersistentServicesLocked();
+ }
}
}
diff --git a/core/java/android/server/search/SearchManagerService.java b/core/java/android/server/search/SearchManagerService.java
index 4a21374..46f2723 100644
--- a/core/java/android/server/search/SearchManagerService.java
+++ b/core/java/android/server/search/SearchManagerService.java
@@ -92,7 +92,7 @@ public class SearchManagerService extends ISearchManager.Stub {
Searchables searchables = mSearchables.get(userId);
if (searchables == null) {
- Log.i(TAG, "Building list of searchable activities for userId=" + userId);
+ //Log.i(TAG, "Building list of searchable activities for userId=" + userId);
searchables = new Searchables(mContext, userId);
searchables.buildSearchableList();
mSearchables.append(userId, searchables);
diff --git a/core/java/com/android/internal/content/PackageHelper.java b/core/java/com/android/internal/content/PackageHelper.java
index c5e7d9d..1a4835b 100644
--- a/core/java/com/android/internal/content/PackageHelper.java
+++ b/core/java/com/android/internal/content/PackageHelper.java
@@ -51,7 +51,7 @@ public class PackageHelper {
public static final int RECOMMEND_FAILED_INVALID_URI = -6;
public static final int RECOMMEND_FAILED_VERSION_DOWNGRADE = -7;
- private static final boolean localLOGV = true;
+ private static final boolean localLOGV = false;
private static final String TAG = "PackageHelper";
// App installation location settings values
public static final int APP_INSTALL_AUTO = 0;
diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml
index 1e966f7..f7ff77b 100644
--- a/core/res/res/values/arrays.xml
+++ b/core/res/res/values/arrays.xml
@@ -143,10 +143,6 @@
<item>@drawable/menu_dropdown_panel_holo_dark</item>
<item>@drawable/overscroll_edge</item>
<item>@drawable/overscroll_glow</item>
- <item>@drawable/popup_inline_error_above_holo_dark</item>
- <item>@drawable/popup_inline_error_above_holo_light</item>
- <item>@drawable/popup_inline_error_holo_dark</item>
- <item>@drawable/popup_inline_error_holo_light</item>
<item>@drawable/spinner_16_outer_holo</item>
<item>@drawable/spinner_16_inner_holo</item>
<item>@drawable/spinner_48_outer_holo</item>
@@ -257,8 +253,6 @@
<item>@drawable/ab_solid_shadow_holo</item>
<item>@drawable/item_background_holo_dark</item>
<item>@drawable/item_background_holo_light</item>
- <item>@drawable/ic_ab_back_holo_dark</item>
- <item>@drawable/ic_ab_back_holo_light</item>
<item>@drawable/fastscroll_thumb_holo</item>
<item>@drawable/fastscroll_thumb_pressed_holo</item>
<item>@drawable/fastscroll_thumb_default_holo</item>