OSDN Git Service

Only send storage intents after boot complete
authorJohan Redestig <johan.redestig@sonymobile.com>
Sat, 18 Jan 2014 21:46:56 +0000 (22:46 +0100)
committerJohan Redestig <johan.redestig@sonymobile.com>
Sat, 18 Jan 2014 21:46:56 +0000 (22:46 +0100)
commit0464c07a9e3f45091d1f9834788646bc8e4a217d
tree970a59f89d8b91979de365c800883ebdfa0cb745
parentc9a60b0f77525244ac4f970258703b8dc62ee140
Only send storage intents after boot complete

It is not possible to send a broadcast before the system
boot is completed. If you do it anyway you will get an
IllegalStateException: Cannot broadcast before boot completed.

If a memory card is inserted or removed while the phone is
booting up, there is a risk that the MountService will try to
broadcast a storage intent too early, and cause the device
to crash.

Use FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT to avoid
problems with too early broadcasts.

Change-Id: Ied36a13d235df37c9788e45a35de40d919ae0cd0
services/java/com/android/server/MountService.java