Tampilkan postingan dengan label fix. Tampilkan semua postingan
Tampilkan postingan dengan label fix. Tampilkan semua postingan

fix Android memory full boot loop soft brick bug

IllegalStateException:
"Cannot broadcast before boot completed"
log:
"Running low on memory. Sending notification"

perhaps this is the most ridiculous bug that annoyed many Android users, especially normal users. if i were not able to find the root cause of this bug, i think i would have to reformat the whole device and start to pray. just can't believe it is still there in Android 4.1.2



what is this about?

during the boot process, the checkMemory function will be called to see if your memory (disk space) is full or nearly full. if this is the case, it will send a "Phone storage is full. Delete some files to free space." notification to the users telling them the device is running out of memory (space). thus, users will be alerted by this notification message which, supposedly, shown as a ticker in the status bar

but for some reasons, all notifications will be "checked" by the verifyBroadcastLocked function before sending to the users by showing a message in the status bar, for instance. the "checking mechanisms" include the status of the device, like whether the phone is booted up already. this is very straight forward since it will be pointness to show any notification if the phone is not booted up yet. these notifications will be dropped or should be queued up and will not be sent to the users until a proper time has come. in this case, screen is on or the home screen (desktop) is drawn could be regarded as a proper time



why is this happening?

if one boots up his device which the memory is neary full, then during the boot process the checkMemory function will send a notification to inform the user about this and logged as "Running low on memory. Sending notification". however, since the device is not booted up yet, the verifyBroadcastLocked function will not allow to send this notification for the reason that the boot process is not yet comlpete and throw an IllegalStateException "Cannot broadcast before boot completed"

when this fatal IllegalStateException is sent by verifyBroadcastLocked and received by the system, the boot process will be crashed. this crash event alerts the system that the previous attempt to boot was a failure, which in turn will try to boot the system again. now the device will begin to boot again and during this second boot, the checkMemory function will send a memory low notification again, followed by another "Cannot broadcast before boot completed" IllegalStateException and hence, a boot loop (some describe as soft brick) is created, as illustrated in a simple flow chart as below:

booting up --> low memory/memory full --> send notification --> notification dropped and IllegalStateException thrown --> failed to boot --> try to boot up again --> booting up --> low memory/memory full ...... --> fail to boot --> try to boot up again ......


so if your phone enters a boot loop for unknown reason, try to take a look at the log. if you find something like "Cannot broadcast before boot completed" or "Running low on memory. Sending notification" in the log file, you will know why and how to solve it



how to solve this problem?
1/. always keep an eye on your phone and make sure you have "sufficient" memory (disk space). unfortunately, the word "sufficient" is defined by Google, the programmers, the manufacturers, etc, which could be 2%, 5%, 10% of the total available memory, and can be different in different Android versions, different firmware versions, etc

2/. modify the sending low memory notifications process by:
a) removing sendNotification in checkMemory function in DeviceStorageMonitorService
b) handling the IllegalStateException thrown by verifyBroadcastLocked in ActivityManagerService in a better way


for me, i opted to disable the sendNotification in DeviceStorageMonitorService.smali found inside services.jar as temporary solution. here's how to (based on stock I9300XXELKC):


[i] find the lines that read like:

const-string v2, "DeviceStorageMonitorService"

const-string v3, "Running low on memory. Sending notification"


[ii] remark the following lines a few lines after [i] (line 229 and 230 in my case, may be differnet for you):

### low memory --> boot loop bug --> Cannot broadcast before boot completed
.line 229
#invoke-direct {p0}, Lcom/android/server/DeviceStorageMonitorService;->sendNotification()V

.line 230
#iput-boolean v7, p0, Lcom/android/server/DeviceStorageMonitorService;->mLowMemFlag:Z


by commenting or removing these lines, no memory full notification will be sent but a log will be printed to the system log, and the memory full boot loop bug can be avoided




force close with JKay Deluxe? try this trick to fix it

just helped my friend to solve his problem. he installed JKay Deluxe 13.2 but he got FC (force close) everytime he pressed the icon. after reading the log file, i tried to see where the problem lies. i decompressed the apk and read the source code in smali and found that the null pointer exception at DeluxeSettings.java line 1976 (or DeluxeSettings$updateSysUI.smali) was caused by the missing 'next_alarm_formatted' entry in the system table, found at /data/data/com.android.providers.settings/databases/settings.db. the lines try to read the value of 'next_alarm_formatted' but not handling null value (missing entry). i then added back an entry with empty value to the database and now it works like a charm!

so if you r facing with similar problem, take a look at your log by ddms (aka dalvik debug monitor) or by adb with the following command if you have the logger module loaded (logger.ko):

adb shell logcat -d | grep jkaysoft

if you find something like:
W/WindowManager( 3342): Window Window{4053d140 Starting com.jkaysoft.gingertheme paused=false} destroyed surface Surface(name=Starting com.jkaysoft.gingertheme, identity=-1, mNativeSurface=0), session Session{407ca078 uid 1000}
E/AndroidRuntime(10191): at com.jkaysoft.gingertheme.DeluxeSettings$updateSysUI.run(DeluxeSettings.java:1976)

then u can easily trace the missing entry at line 1976 (not exactly at line 1976, search for '.line 1976' instead), if you r comfortable with editing or reading the smali files, and add it back to the db with sqlite

anyway, i will report the problem to _JKay_ so just be patient if u dono how to fix it or don wanna read the smali files

I9000XXJVP 2.3.4 available for update

I9000XXJVP (XEU) 2.3.4 is available now, which is 'supposed' to fix a security hole that allow hackers to compromise and steal personal data including phone book from your device

gingerbread sms no contact limit + no mms autoconvert + sent time fix

the long awaited gingerbread sms mod for deodexed I9000XWJVB and I9000XWJVH are out finally. they are not modded by me this time but, instead, by another nice guy called montymintypie in the xda forum, who also fixed the limit of number of msgs per sms and the auto convert to mms problem


more info and download

more info about my froyo version sms sent time fix for I9000XWJS5 and I9000XXJPX/I9000XXJPY

Gingerbread 2.3.3 upgrade aborted?

it is reported that Gingerbread upgrade has been pulled by Google. the mentioned rom, I9000XXJVK, which was available in UK via Kies, was pulled off

below is an extract from the message posted by an administrator from Vodafone:

Due to an issue with the Gingerbread update for the Samsung Galaxy S, its roll out has been temporarily suspended by Google... we are working with Samsung to reinstate the roll out as soon as possible...




on the other hand however, some people claimed that it was due to a call delay bug on incoming and outgoing calls in 2.3.3


source: www.engadget.com

fail to install apps? try this solution

when you download and install apps from the market, sometimes you will find that INSTALL_FAILED_CONTAINER_ERROR in the log or "Application not installed" error

they are usually SDCARD related problem, do this and reinstall your app and see if it helps:

- unmount external sdcard
goto settings-> sd card and phone storage -> unmount sd card

if you can install the app after, then it's should be sdcard related problem. to avoid or fix this permanently, do this (root is needed):

- change the permission of /mnt/secure/asec/smdl2tmp1.asec to 777
OR
- delete /mnt/secure/asec/smdl2tmp1.asec

possible solution for the malwares affected Android phones

in short, if your phone is rooted, just create an empty file called profile under /system/bin/

in adb shell, change to root user and then do the followings:
touch /system/bin/profile; chmod 644 /system/bin/profile

notice that you may have to remount the /system partition as rw (with read/write permission) first by issuing the command:
mount -o remount,rw /system


more info and alternative solutions

JPY sms sent time fix works in JS5

tested and confirmed it's working fine in I9000XWJS5. and it seems the sorting problem for immediate reply is solved











reference:
let Android SMS messages show sent time instead of received time

some reviews about my works

let Android SMS messages show sent time instead of received time

how come all sms use received time as timestamp? for me it's very misleading, so i made this
this mod will show the original sent time by the sender in the sms message instead received time when new message arrives


be sure the original Mms.odex is renamed/removed

for I9000JPX, I9000JPY
get them here


more info