OSDN Git Service

resolved conflicts for merge of 2ecce34f to master
authorDianne Hackborn <hackbod@google.com>
Sat, 13 Mar 2010 00:46:46 +0000 (16:46 -0800)
committerDianne Hackborn <hackbod@google.com>
Sat, 13 Mar 2010 00:46:46 +0000 (16:46 -0800)
Change-Id: Ic4e38199beaf8c16f9d28ac5296e8aaa61788b36

1  2 
services/java/com/android/server/am/ActivityManagerService.java

@@@ -3513,10 -3563,10 +3513,10 @@@ public final class ActivityManagerServi
              }
              r.task = new TaskRecord(mCurTask, r.info, intent,
                      (r.info.flags&ActivityInfo.FLAG_CLEAR_TASK_ON_LAUNCH) != 0);
 -            if (DEBUG_TASKS) Log.v(TAG, "Starting new activity " + r
 +            if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r
                      + " in new task " + r.task);
              newTask = true;
-             addRecentTask(r.task);
+             addRecentTaskLocked(r.task);
              
          } else if (sourceRecord != null) {
              if (!addingToTask &&
              mWindowManager.validateAppTokens(mHistory);
          }
  
-         finishTaskMove(task);
+         finishTaskMoveLocked(task);
 -        EventLog.writeEvent(LOG_TASK_TO_FRONT, task);
 +        EventLog.writeEvent(EventLogTags.AM_TASK_TO_FRONT, task);
      }
  
-     private final void finishTaskMove(int task) {
+     private final void finishTaskMoveLocked(int task) {
          resumeTopActivityLocked(null);
      }
  
      }
  
      public static final void installSystemProviders() {
-         ProcessRecord app = mSelf.mProcessNames.get("system", Process.SYSTEM_UID);
-         List providers = mSelf.generateApplicationProvidersLocked(app);
-         if (providers != null) {
-             for (int i=providers.size()-1; i>=0; i--) {
-                 ProviderInfo pi = (ProviderInfo)providers.get(i);
-                 if ((pi.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM) == 0) {
-                     Slog.w(TAG, "Not installing system proc provider " + pi.name
-                             + ": not system .apk");
-                     providers.remove(i);
 -        List providers = null;
++        List providers;
+         synchronized (mSelf) {
+             ProcessRecord app = mSelf.mProcessNames.get("system", Process.SYSTEM_UID);
+             providers = mSelf.generateApplicationProvidersLocked(app);
++            if (providers != null) {
++                for (int i=providers.size()-1; i>=0; i--) {
++                    ProviderInfo pi = (ProviderInfo)providers.get(i);
++                    if ((pi.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM) == 0) {
++                        Slog.w(TAG, "Not installing system proc provider " + pi.name
++                                + ": not system .apk");
++                        providers.remove(i);
++                    }
 +                }
 +            }
          }
-         mSystemThread.installSystemProviders(providers);
+         if (providers != null) {
+             mSystemThread.installSystemProviders(providers);
+         }
      }
  
      // =========================================================
          }
      }
  
 +    public boolean isUserAMonkey() {
 +        // For now the fact that there is a controller implies
 +        // we have a monkey.
 +        synchronized (this) {
 +            return mController != null;
 +        }
 +    }
 +    
      public void registerActivityWatcher(IActivityWatcher watcher) {
-         mWatchers.register(watcher);
+         synchronized (this) {
+             mWatchers.register(watcher);
+         }
      }
  
      public void unregisterActivityWatcher(IActivityWatcher watcher) {