OSDN Git Service

Fix issue #8582003: Evernote Camera Capture Failure
authorDianne Hackborn <hackbod@google.com>
Fri, 12 Apr 2013 00:29:32 +0000 (17:29 -0700)
committerDianne Hackborn <hackbod@google.com>
Fri, 12 Apr 2013 00:29:32 +0000 (17:29 -0700)
ActivityThread.currentPackageName() was actually returning
the process name.  Change this to return the package name, and
fix the one spot using it I could find that was actually wanting
the process name.

Change-Id: I323b9c5987106b5a090968e545281fc0ba55b6b8

core/java/android/app/ActivityThread.java
packages/FakeOemFeatures/src/com/android/fakeoemfeatures/FakeApp.java

index e6ce963..d4056c9 100644 (file)
@@ -1595,6 +1595,12 @@ public final class ActivityThread {
     public static String currentPackageName() {
         ActivityThread am = currentActivityThread();
         return (am != null && am.mBoundApplication != null)
+            ? am.mBoundApplication.appInfo.packageName : null;
+    }
+
+    public static String currentProcessName() {
+        ActivityThread am = currentActivityThread();
+        return (am != null && am.mBoundApplication != null)
             ? am.mBoundApplication.processName : null;
     }
 
index f11b499..36ce7ce 100644 (file)
@@ -86,7 +86,7 @@ public class FakeApp extends Application {
 
     @Override
     public void onCreate() {
-        String processName = ActivityThread.currentPackageName();
+        String processName = ActivityThread.currentProcessName();
         Slog.i("FakeOEMFeatures", "Creating app in process: " + processName);
         if (!getApplicationInfo().packageName.equals(processName)) {
             // If we are not in the main process of the app, then don't do