11
Posted by alex on Nov 24th, 2014

android-logo-298x300-1.jpgAndroid reserves a certain percentage of the data partition for itself to make sure apps won't run out of working space (Receiving SMS, emails, call logs, etc). On phones with no external storage it means that when you are down to 10% free OR 500MB (whichever is smaller) you won't be able to update/install anything, even if it's only a couple kilobytes. It's really annoying for devices with 4-8GB to lose 500MB like that.
 

IMPORTANT: If you have plenty of space available and yet have the insufficient storage error, you should look elsewhere to fix your issue. The following guide is only to reclaim the 10% remaining, not fix Play Store issues. The procedure should work with any Android 4.x, but it was tested only on stock Moto G and LG G1.

How to

Before starting you need to choose how much space you wish to reserve for Android. You can choose a percentage, a size, or both (the system will pick the smallest value). This guide uses 100MB and 2%, change values accordingly. You need to be rooted. Procedure overview (step-by-step below):

Database Path: /data/data/com.android.providers.settings/databases/settings.db

Insert rows in table: global

name value
sys_storage_threshold_percentage 2
sys_storage_threshold_max_bytes

104857600

 

Note: In older Android the table might be named secure. If that is the case please replace global by secure in the following instructions. Thanks to Patrick in the comments!

 

Using a sqlite3 editor:
  1. Get a rooted sqlite3 editor from the play store. I tested this procedure successfully with SQLite Debugger and aSQLiteManager. SQLite Master Pro is easier to use but not free.
  2. Open the aforementioned database.
  3. Navigate to the table named global.
  4. Insert the rows as specified. (when inserting only fill name/value, leave the remaining fields empty)
  5. reboot!
Using the command line:
  1. You will need a rooted phone with sqlite3. If you do not have the sqlite3 command installed, try this one or try the Sqlite3 installer.
  2. Connect to your phone via adb shell or use a root terminal emulator.
  3. # sqlite3 /data/data/com.android.providers.settings/databases/settings.db
    SQLite version 3.8.6 2014-08-15 11:46:33
    Enter ".help" for usage hints.
    sqlite> replace into global (name, value) values('sys_storage_threshold_percentage', '2');
    sqlite> replace into global (name, value) values('sys_storage_threshold_max_bytes', '104857600');
    sqlite> .quit
    # reboot

You should be able to install more apps now :)

 

Look further

A quick note about the table name first: I instructed you to insert lines in the "global" table. I believe the proper place for all Android is the "secure" table and "global" has the ability to override settings from "secure". I have not tested recent Android 4+ with "secure" instead of "global", that's why I kept "global" above.

Here's some technical info if you want to patch at the rom level or write an xposed mod or whatever:

I tracked the check down to getMemThreshold() in DeviceStorageMonitorService.java.

private long getMemThreshold() {
     long value = Settings.Secure.getInt(
                            mContentResolver,
                            Settings.Secure.SYS_STORAGE_THRESHOLD_PERCENTAGE,
                            DEFAULT_THRESHOLD_PERCENTAGE);
         if(localLOGV) Slog.v(TAG, "Threshold Percentage="+value);
         value *= mTotalMemory;
         long maxValue = Settings.Secure.getInt(
                 mContentResolver,
                Settings.Secure.SYS_STORAGE_THRESHOLD_MAX_BYTES,
                DEFAULT_THRESHOLD_MAX_BYTES);
    //evaluate threshold value
    return value < maxValue ? value : maxValue;
}

The default value is specified earlier in the same file:

private static final int DEFAULT_THRESHOLD_PERCENTAGE = 10;
private static final int DEFAULT_THRESHOLD_MAX_BYTES = 500*1024*1024; // 500MB

The setting key can be found in frameworks/base/core/java/android/provider/Settings.java

The installer calls it from PackageManagerService.java in checkFreeStorage()

 

Method with Tasker:

(From Daniel in the comments.)

For those having tasker it is even easier:

Task with this 2 actions:

  1. Run shell (under code) - enter the following values
    1. Command: sqlite3 /data/data/com.android.providers.settings/databases/settings.db "replace into global (name, value) values('sys_storage_threshold_percentage', '2')";
    2. Tick "use root"
    3. If you want you can save the error output and display it with a notify action
  2.  2nd action same but put this command:
    1. sqlite3 /data/data/com.android.providers.settings/databases/settings.db "replace into global (name, value) values('sys_storage_threshold_max_bytes', '104857600')";

Run the task and reboot ...

Read more...
11 comments
4
Posted by alex on Oct 9th, 2014

unnamed.pngUpdating Chrome on Android is always a gamble. If I were to pick a game to best describe the experience I'd choose Russian roulette. Sometimes everything is fine, improved even. But too often things fall apart, up to the point you may reluctantly have to revert to the factory version. You may choose, like me, to preemptively remain on an older version. It works fine, if you can live with chrome prompting you to update to a "newer, greater version" at each start...

But you like your current version and you don't want to be prompted to update each time you tap the Chrome icon... There is no setting that I could find to disable this behavior.

Luckily if you are rooted you can manually edit one of Chrome's config file, the one concerning Omaha aka Google Update. You will need a root text editor or file manager, I use ES File Explorer
with root enabled (swipe the left pane).L93.png

Note: This will not disable the Play Store auto-update or manual update. It will only hide the annoying "Chrome just got better" prompts when you start Chrome.

 

Before starting make sure to swipe Chrome away from the activity view , it will avoid having Chrome overwriting your changes.

I've added a second (non-tested) method, scroll down to see it. It is actually much simpler, maybe it's worth trying first.

Read more...
4 comments
0
Posted by alex on Jul 1st, 2014

sP6-1.pngPbCounter is a small Windows utility that counts how many times each mouse button and each keyboard key is pressed. With these statistics it does three things:

  1. Display the counters, obviously :)
  2. Create an heat map to put in evidence the most used keys on your keyboard
  3. Upload the statistics at regular interval to a web page of your choice (an example PHP script here or source)

It is purposely compatible with scripts made for Mousotron. It takes less than 3MB of ram and uses very little CPU.

Configuration can be done by editing the ini file, more information included in the help file. Important: While it tracks how many times each key is pressed, it doesn't record what you type (it is not a keylogger).

 

dtY-1.png

 

The program is free to use and modify under the MIT license. If you want to compile it you will need PureBasic 5+ (The demo won't work as PbCounter uses the win32 API).

 

Download

 

Tags: Click counter, Mouse Spy, Keyboard activity, Statistics

0 comment
0
Posted by alex on Jun 13th, 2014

Here's a short overview of the Montreal Mini Maker Faire 2014. As usual, pictures are provided by Pascal :)

Read more...
0 comment
Go to Top