History log of /frameworks/base/core/java/android/app/ApplicationErrorReport.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dfa34cd517dfb794e31598211ed0fc8a419ddc28 31-Jul-2014 louis_chang <louis_chang@htc.com> Avoid system server crash due to package removed

Cherry-picked from aosp.

Fixes bug 18593178.

Symptom:
When application is not responding, an ANR dialog will shown.
In certain timing, user uninstall the application when the ANR
occurs, but before ANR dialog shown. The system server will crash
when looking up the errorReportReceiver because the package is removed.

Here shows how the exception occurs.
java.lang.IllegalArgumentException: Unknown package: app.package.name
at com.android.server.pm.Settings.getInstallerPackageNameLPr
at com.android.server.pm.PackageManagerService.getInstallerPackageName
at android.app.ApplicationPackageManager.getInstallerPackageName
at android.app.ApplicationErrorReport.getErrorReportReceiver
at com.android.server.am.ActivityManagerService.startAppProblemLocked
at com.android.server.am.ActivityManagerService.makeAppNotRespondingLocked
at com.android.server.am.ActivityManagerService.appNotResponding

Change-Id: Iced4287bd44dc25b1db2c1e3a583892eb6c041a2
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
f85e7af4d009862fc799c7232ec5cf9e2dc9fa34 14-Oct-2014 Dianne Hackborn <hackbod@google.com> Fix issue #10034864: Define YouTube application as the preferred...

...handler for its Intents

Fix bug when a third party app is installed as an additional but
worse match for the intent.

Also raise up the limit for when we start printing logs about
overly large strict mode data.

And turn off the logs about services being created and destroyed,
since with the way things are using services these days these have
become way too spammy.

Change-Id: I8fe301dfd80fb4b70213cb7783b7c5426245278d
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
ce92b0d070c4967914698b4e257c203d7121c972 30-Sep-2014 Dianne Hackborn <hackbod@google.com> More work on issue #17656716: Unhandled exception in Window Manager

Drop down the limit on when we log, since under normal operation we
will never get more than a few K of data due to strict mode.

Try to clean up the code paths coming in and out of binder IPCs to
plug any places where we could disrupt the gather flag of a thread,
causing it to keep gathering stack crawls (which is the thing that
is causing our strict mode data to become so large).

Change-Id: I9a46512283d33e863c429840b465855d1fabb74e
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
73d6a821aeecd6003c70c32f7ae6c38f062c4290 29-Sep-2014 Dianne Hackborn <hackbod@google.com> Work on issue #17656716: Unhandled exception in Window Manager

Remove the checks for large parcel sizes. Those were triggering,
and identifyng the area of the problem, but also cause a lot of
trouble by making the unsafe deadlocky code there much more likely
to deadlock.

Add logging for strict mode IPCs, since those seem to be the
problem. Only log when things look bad.

Also add a log when battery stats are reset, to diagnose why they
are getting reset when they shouldn't be.

Change-Id: I588c858fb8d8c45f3c9c164ae2de9ae01547b304
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
6090995951c6e2e4dcf38102f01793f8a94166e1 19-Nov-2013 John Spurlock <jspurlock@google.com> Remove unused imports from frameworks/base.

Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
8c84109b9fbbf473b225707a38261ff5f99d95fb 24-Jun-2013 Dianne Hackborn <hackbod@google.com> Use FastPrintWriter... everywhere.

One problem this turned up is, because FastPrintWriter does
its own buffering, a lot of code that used to use PrintWriter
would fail -- if it pointed to a StringWriter, there was no
buffering, so it could just immediately get the result. Now
you need to first flush the FastPrintWriter.

Also added some new constructors to specify the size of buffer
that FastPrintWriter should use.

Change-Id: If48cd28d7be0b6b3278bbb69a8357e6ce88cf54a
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
625239a05401bbf18b04d9874cea3f82da7c29a1 27-Sep-2012 Jeff Sharkey <jsharkey@android.com> Migrate more Secure settings to Global.

Migrate networking, storage, battery, DropBox, and PackageManager
related Secure settings to Global table.

Bug: 7232014, 7231331, 7231198
Change-Id: I772c2a9586a2f708c9db95622477f235064b8f4d
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
4d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219 28-Jan-2012 Dirk Dougherty <ddougherty@google.com> Doc change: String changes for Android Market

Change-Id: I823812a4fd24021bec906ad856479c92a8d2a759
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
8e8d65ff5fdef12c6af3d003dfef19aadc39bea9 12-Aug-2011 Dianne Hackborn <hackbod@google.com> Fix some crashes that are happening in the system process.

- When shutting down, if the screen goes to sleep there is code
that tries to do a notifyAll without holding the lock:

java.lang.IllegalMonitorStateException: object not locked by thread before notifyAll()
at java.lang.Object.notifyAll(Native Method)
at com.android.server.am.ActivityStack.checkReadyForSleepLocked(ActivityStack.java:776)
at com.android.server.am.ActivityStack$1.handleMessage(ActivityStack.java:282)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at com.android.server.ServerThread.run(SystemServer.java:603)

- If an invalid Uri object is sent to the system process it can crash because
the Uri class throws an assertion while unmarshalling. Change this to an
IllegalArgumentException so it gets sent back to the caller:

java.lang.AssertionError
at android.net.Uri$PathPart.readFrom(Uri.java:2224)
at android.net.Uri$HierarchicalUri.readFrom(Uri.java:1106)
at android.net.Uri$1.createFromParcel(Uri.java:1689)
at android.net.Uri$1.createFromParcel(Uri.java:1681)
at android.content.IContentService$Stub.onTransact(IContentService.java:53)
at android.content.ContentService.onTransact(ContentService.java:120)
at android.os.Binder.execTransact(Binder.java:338)
at dalvik.system.NativeStart.run(Native Method)

- StrictMode can try to access the first index in the stack crawl of a stack crawl
array of length 0. Not sure why this happens, but make the code more robust:

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
at android.app.ApplicationErrorReport$CrashInfo.<init>(ApplicationErrorReport.java:341)
at android.os.StrictMode$ViolationInfo.<init>(StrictMode.java:1978)
at android.os.StrictMode$AndroidBlockGuardPolicy.startHandlingViolationException(StrictMode.java:1097)
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1068)
at libcore.io.BlockGuardOs.read(BlockGuardOs.java:137)
at libcore.io.IoBridge.read(IoBridge.java:426)
at java.io.FileInputStream.read(FileInputStream.java:179)
at java.io.InputStream.read(InputStream.java:148)
at com.android.internal.os.ProcessStats.readFile(ProcessStats.java:804)
at com.android.internal.os.ProcessStats.getCpuSpeedTimes(ProcessStats.java:564)
at com.android.internal.os.ProcessStats.getLastCpuSpeedTimes(ProcessStats.java:545)
at com.android.server.am.ActivityManagerService.updateCpuStatsNow(ActivityManagerService.java:1470)
at com.android.server.am.ActivityManagerService.batteryNeedsCpuUpdate(ActivityManagerService.java:1522)
at com.android.internal.os.BatteryStatsImpl$MyHandler.handleMessage(BatteryStatsImpl.java:110)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1302)

(Also fix this code to not cause strict mode to trigger at all, because there is
no need, because this is just reading stuff from /proc.)

- The system seems to crash during boot if it thinks it needs to rotate
the screen, when it is trying to take the freeze snapshot way too early.
There is no need to freeze the screen during boot or if the screen is off:

java.lang.NullPointerException
at android.view.Surface.init(Native Method)
at android.view.Surface.<init>(Surface.java:256)
at com.android.server.wm.ScreenRotationAnimation.<init>(ScreenRotationAnimation.java:91)
at com.android.server.wm.WindowManagerService.startFreezingDisplayLocked(WindowManagerService.java:8758)
at com.android.server.wm.WindowManagerService.startAppFreezingScreenLocked(WindowManagerService.java:3971)
at com.android.server.wm.WindowManagerService.startAppFreezingScreen(WindowManagerService.java:4003)
at com.android.server.am.ActivityRecord.startFreezingScreenLocked(ActivityRecord.java:515)
at com.android.server.am.ActivityStack.ensureActivityConfigurationLocked(ActivityStack.java:3997)
at com.android.server.am.ActivityManagerService.updateConfigurationLocked(ActivityManagerService.java:12535)
at com.android.server.am.ActivityManagerService.updateConfiguration(ActivityManagerService.java:12439)
at com.android.server.wm.WindowManagerService.systemReady(WindowManagerService.java:6161)
at com.android.server.ServerThread.run(SystemServer.java:521)

Change-Id: I85062bb5f6b0909a0f52feedaa75e7611d9d7fbd
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
271c2fe0eb36fbf872535bedf3ee8156e3087847 10-Aug-2011 Dianne Hackborn <hackbod@google.com> New extended Intent protcols for installing/uninstalling apps.

Change-Id: I13be1cc58c91f51d521a1f0f734d2b2db7b2980b
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
87d0b2f42209ab1dd4eed71e3b74b31bbcccf663 02-Aug-2010 Jacek Surazski <jaceks@google.com> Add dumping of Running Service reports to ApplicationErrorReports

Change-Id: I5f10bf81af384777da2ac2d2c00463b766a4fb67
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
e2d33bbc496192d49c1e48baad446d8d0720d301 31-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> am d2165cfc: Merge "StrictMode: time violations in Binder calls" into gingerbread

Merge commit 'd2165cfce7911dac66d1195ed9123e79b086d22b' into gingerbread-plus-aosp

* commit 'd2165cfce7911dac66d1195ed9123e79b086d22b':
StrictMode: time violations in Binder calls
cb9ceb1029036363a81952d8ed5dfcbc83e6ff72 29-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: time violations in Binder calls

Change-Id: I5796993dce98be722cf679b78acaf0c9de0ba461
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
b6022e3d500f248cf1abe94e8f1509e27ab25736 26-Jul-2010 Dianne Hackborn <hackbod@google.com> am 14bfa398: Infrastructure to report running services to developer.

Merge commit '14bfa398a4e8697ce5822861a684b7d1245e4a85' into gingerbread-plus-aosp

* commit '14bfa398a4e8697ce5822861a684b7d1245e4a85':
Infrastructure to report running services to developer.
14bfa398a4e8697ce5822861a684b7d1245e4a85 25-Jul-2010 Dianne Hackborn <hackbod@google.com> Infrastructure to report running services to developer.

Change-Id: Id1aae61323e7b8357c5fcc4bc641aaa57f3b6fde
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
fcff691057fecdedd6d3033da672d1a473c76066 20-Jul-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I2a8ec9d290fc1040ba53b9fe73f92b7f90dfdf16
ae96f634eccf86ff80e339c9e9a2abbad3f2a02d 19-Jun-2010 Madan Ankapura <mankapur@sta.samsung.com> typo fixed

Change-Id: Ie7cff39929ae53ce03409afadcae58548ec22cc8
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
5b747191ff8ad43a54d41faf50436271d1d7fcc8 12-Jul-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: gather and return violating stacks in Binder replies

Now, when Thread A has a strict mode policy in effect and does a
Binder call to Thread B (most likely in another process), the strict
mode policy is passed along, but with the GATHER penalty bit set which
overrides other policies and instead gathers all offending stack
traces to a threadlocal which are then written back in the Parcel's
reply header.

Change-Id: I7d4497032a0609b37b1a2a15855f5c929ba0584d
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
143666f0ca28f0e3e6597e5025078f0449ca6abe 14-Jun-2010 Brad Fitzpatrick <bradfitz@android.com> StrictMode: implement the log-to-DropBox option

Change-Id: I51d12e264155078f953028241f8c5cbdc47262e8
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
46d42387464a651268648659e91d022566d4844c 11-Jun-2010 Brad Fitzpatrick <bradfitz@android.com> More StrictMode work, handling violations in ActivityManagerService.

Also starts to do duplicate-suppression.

Change-Id: I0502f6ab6c45fa319298de4874ecfe44b7829d21
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
151de3d9df60cf0340e06a3aa1e7a31691fd9bf9 26-Feb-2010 Jacek Surazski <jaceks@google.com> Add BatteryInfo to ApplicationErrorReport.
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
21f1bd17b2dfe361acbb28453b3f3b1a110932fa 20-Feb-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2438980: Implement package watcher for voice recognizer service setting

I am getting tired of writing package monitor code, realized this is missing in
a number of places, and at this point it has gotten complicated enough that I
don't think anyone actually does it 100% right so:

Introducing PackageMonitor.

Yes there are no Java docs. I am still playing around with just what this
thing is to figure out what makes sense and how people will use it. It is
being used to fix this bug for monitoring voice recognizers (integrating the
code from the settings provider for setting an initial value), to replace
the existing code for monitoring input methods (and fix the bug where we
wouldn't remove an input method from the enabled list when it got
uninstalled), to now monitor live wallpaper package changes (now allowing
us to avoid reverting back to the default live wallpaper when the current
one is updated!), and to monitor device admin changes.

Also includes a fix so you can't uninstall an .apk that is currently enabled
as a device admin.

Also includes a fix where the default time zone was not initialized early
enough which should fix issue #2455507 (Observed Google services frame work crash).

In addition, this finally introduces a mechanism to determine if the
"force stop" button should be enabled, with convenience in PackageMonitor
for system services to handle it. All services have been updated to support
this. There is also new infrastructure for reporting battery usage as an
applicatin error report.
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
e0ee6efb1e5bc6cf219555e333635ce98531bc85 07-Jan-2010 Jacek Surazski <jaceks@google.com> Add systemApp field to ApplicationErrorReport
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
60d8762413e8daba5f73559786312a9ec5e3b827 17-Dec-2009 Dan Egnor <egnor@google.com> DropBox logging of app & system server crashes.

The crashes are also reported to the event log (and of course the
main logcat, like they always have been). Ordinary Log.e(t,m,e) isn't dropboxed
but there's a new Log.wtf() which always is. (Still @pending in this change.)

Add a hook to IPowerManager to crash the system server on demand
(only for apps with REBOOT permission, since it's basically a restart).
This is not exposed in PowerManager, must be invoked directly -- mostly
this is there so "Bad Behavior" in dev tools can do it.
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
b7f0367cec1c744aa66ef397b0244e25d507491c 10-Dec-2009 Dan Egnor <egnor@google.com> Eliminate CrashData and friends.

(CrashData was a custom-marshalled crash-info class used for a server crash
reporting system I am deprecating). Use ApplicationErrorReport.CrashInfo
instead to report crash details (mostly the stack trace) from RuntimeInfo to
ActivityManagerService, since we're likely to need the crash information in
that form anyway.

Remove the (long-disabled) flags and support for the "Debug" button
in the crash dialog.

Further gut the ICheckinService interface by removing the crash-reporting
APIs (and everything that calls them), plus the synchronous checkin()
method (which has been stubbed out for a while now).

A new dropbox-based crash reporting system is in the works, but not part
of this change.
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
5a12373277f6ce14101f08580bc4f08f9a3d7c50 23-Jun-2009 Jacek Surazski <jaceks@google.com> Add exception line number to ApplicationErrorReport
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
f829a78f6c78141d2cf8074f00fcded37fbf9007 11-Jun-2009 Jacek Surazski <jaceks@google.com> add exception message to ApplicationErrorReport

useful signal for clustering
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
fd0bdcc344488df468ae6d7e89a32febd4bfe300 27-May-2009 Jacek Surazski <jaceks@google.com> This function should be public
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
28b0e5d06a04f6fa13edbb28de1dd226a158f724 25-May-2009 Jacek Surazski <jaceks@google.com> This just makes it easier to derive from ApplicationErrorReport.
/frameworks/base/core/java/android/app/ApplicationErrorReport.java
f5b9c72022f574417862e064cc0fdd8ea2d846dc 18-May-2009 Jacek Surazski <jaceks@google.com> ActivityManagerService sends bug reports on crashes and ANRs

If an installerPackageName was specified when the app was installed,
looks for a receiver of ACTION_APP_ERROR in that package. If found,
this is the bug report receiver and the crash/ANR dialog will get a
"Report" button. If pressed, a bug report will be delivered.
/frameworks/base/core/java/android/app/ApplicationErrorReport.java