Skip to content

Commit

Permalink
[R43] Upgrade patches. Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
duanqizhi committed Feb 12, 2014
1 parent 7976b3a commit 652bf39
Show file tree
Hide file tree
Showing 4 changed files with 337 additions and 126 deletions.
126 changes: 0 additions & 126 deletions 0001-R43-upgrade-patches.patch

This file was deleted.

15 changes: 15 additions & 0 deletions autopatch/patchall/patchall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,19 @@
patch="revise-Multitheme-ActivityManagerService.xml" />
</feature>

<feature require="OPTION" description="Add isLowRamDevice interface to switch some features" >
<revise action="MERGE"
target="framework.jar.out/smali/android/app/ActivityManager.smali"
patch="revise-ActivityManager.xml" >
</revise>
</feature>

<feature require="OPTION" description="Add phone label info to CallerInfo" >
<revise action="REPLACE" target="framework.jar.out/smali/com/android/internal/telephony/CallerInfoAsyncQuery*" />
<revise action="MERGE"
target="framework.jar.out/smali/com/android/internal/telephony/CallerInfo.smali"
patch="revise-CallerInfo.xml" >
</revise>
</feature>

</features>
128 changes: 128 additions & 0 deletions autopatch/patchall/revise-ActivityManager.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<merge>

<item action="ADD"
position="BELOW"
anchor="# static fields" >
.field private static mIsLowMemoryReadStatus:I
</item>

<item action="ADD"
nearby=".method static constructor &lt;clinit&gt;()V"
position="OVER"
anchor="return-void" >
const/4 v0, -0x1

sput v0, Landroid/app/ActivityManager;->mIsLowMemoryReadStatus:I
</item>

<item action="ADD"
position="OVER"
anchor="EOF">
.method public isLowRamDevice()Z
.locals 1

.prologue
invoke-static {}, Landroid/app/ActivityManager;->isLowRamDeviceStatic()Z

move-result v0

return v0
.end method

.method public static isLowRamDeviceStatic()Z
.locals 9

.prologue
const/4 v4, 0x0

const/4 v3, 0x1

.line 394
sget v2, Landroid/app/ActivityManager;->mIsLowMemoryReadStatus:I

const/4 v5, -0x1

if-ne v2, v5, :cond_1

.line 395
new-instance v1, Lcom/android/internal/util/MemInfoReader;

invoke-direct {v1}, Lcom/android/internal/util/MemInfoReader;->&lt;init&gt;()V

.line 396
.local v1, reader:Lcom/android/internal/util/MemInfoReader;
invoke-virtual {v1}, Lcom/android/internal/util/MemInfoReader;->readMemInfo()V

.line 397
const-string v2, "true"

const-string v5, "ro.config.low_ram"

const-string v6, "false"

invoke-static {v5, v6}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

move-result-object v5

invoke-virtual {v2, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v2

if-nez v2, :cond_0

invoke-virtual {v1}, Lcom/android/internal/util/MemInfoReader;->getTotalSize()J

move-result-wide v5

const-wide/32 v7, 0x20000000

cmp-long v2, v5, v7

if-gez v2, :cond_2

:cond_0
move v0, v3

.line 399
.local v0, isLow:Z
:goto_0
if-eqz v0, :cond_3

move v2, v3

:goto_1
sput v2, Landroid/app/ActivityManager;->mIsLowMemoryReadStatus:I

.line 401
:cond_1
sget v2, Landroid/app/ActivityManager;->mIsLowMemoryReadStatus:I

if-ne v2, v3, :cond_4

:goto_2
return v3

.end local v0 #isLow:Z
:cond_2
move v0, v4

.line 397
goto :goto_0

.restart local v0 #isLow:Z
:cond_3
move v2, v4

.line 399
goto :goto_1

:cond_4
move v3, v4

.line 401
goto :goto_2
.end method
</item>

</merge>
Loading

0 comments on commit 652bf39

Please sign in to comment.