Project

General

Profile

Issue #1245

Fix issue #8470131: Process thrash kills battery

Added by My Self over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Target version:
Start date:
03/30/2015
Due date:
% Done:

100%

Estimated time:
Resolution:
fixed
Device:

Description

I've researched a bit because of the battery consumption thread: http://redmine.replicant.us/boards/9/topics/7953 and found inside the changelog from upper Android versions (http://aosp.changelog.to/aosp-JDQ39-JWR64.html) the following patch: https://android.googlesource.com/platform/frameworks/base/+/a40cfeb with the following description:
Protect app widget broadcasts from abuse.
In this case the app was sending an APPWIDGET_UPDATE broadcast without specifying a target, which
(a) should not be allowed (you should not be able to send updates to other apps), and
(b) resulted in every single potential app widget in the system being launched... which was about 75 of them.

The source code has the following summarized comments:
"[...] we don't want apps to send this, but historically it has not been protected and apps may be using it
to poke their own app widget. So, instead of making it protected, just limit it to the caller."

With other words, this patch will limit the (APPWIDGET_UPDATE-)broadcasts (sent by the apps) to their own packages:

if (callerApp == null) {
String msg = "Permission Denial: not allowed to send broadcast " 

[this goes to the (a) from the headline-description]
and prevent every single potential app widget in the system from being launched, (triggered by this broadcasts) which drains the battery unnecessarily.
[which goes to the (b) from the headline-description].


Files

Bugfix-8470131.patch (10.3 KB) Bugfix-8470131.patch My Self, 08/26/2015 11:32 AM

History

#1

Updated by My Self over 5 years ago

#2

Updated by My Self almost 5 years ago

  • File Bugfix-8470131.patch added

I decided to attach the patch listed above, (and tested with the current Replicant 4.2 sources) on this ticket.
After flashing the patched Replicant, I've tested my productive device several months without any misbehavior.

@everyone: please review the patches and apply them if you like.

#3

Updated by My Self almost 5 years ago

  • % Done changed from 0 to 100
#4

Updated by Paul Kocialkowski almost 5 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Merged, thanks!

#5

Updated by My Self almost 5 years ago

  • File deleted (Bugfix-8470131.patch)

Also available in: Atom PDF