Este foro usa cookies
Este foro hace uso de cookies para almacenar su información de inicio de sesión si está registrado, y su última visita si no lo está. Las cookies son pequeños documentos de texto almacenados en su computadora; las cookies establecidas por este foro solo se pueden usar en este sitio web y no representan ningún riesgo de seguridad. Las cookies en este foro también rastrean los temas específicos que ha leído y la última vez que los leyó. Por favor, confirme si acepta o rechaza el establecimiento de estas cookies.

Se almacenará una cookie en su navegador, independientemente de su elección, para evitar que le vuelvan a hacer esta pregunta. Podrá cambiar la configuración de sus cookies en cualquier momento utilizando el enlace en el pie de página.

Calificación:
  • 1 voto(s) - 5 Media
  • 1
  • 2
  • 3
  • 4
  • 5
MOD Save some battery in status bar during screens backgrounds changes
#1
Easy mod to save a bit of battery.

When the screen goes from dark background to light background or viceverse there is an animation in systemui (nougat stock s7e) to progressively tinting status bar icons.
This animation calls 3-4 times to the method managing the icons tint (icons, texts..).

So, we will reduce to 2 times the number of calls taken into account. We will expend some instructions to check if the tinting has to be applied, nothing compared to the number of instructions if we would leave it stock. I do not see a huge difference in the effect

- Decompile SystemUI

- Edit com/android/systemui/statusbar/phone/StatusBarIconController.smali

- Do the following changes in this method


--------------------------
Vamos a salvar un poco de batería evitando un montonazo de instrucciones mediante la limitación del número de veces que se aplica el tintado de los iconos y resto de vistas existentes en la barra de estado. Para ello, limitamos el número de veces que se ejecuta el tintado por causa de la animación de transición existente, en las transiciones de fondos oscuros a claros o viceversa . Ya sabéis, granito a granito.. Añadimos unas pocas lineas a cambio de evitar un montón de líneas..


----------------------




Código:
.method private setIconTintInternal(F)V
    .locals 4 ### change locals 3 to 4

### add these lines

float-to-int v1, p1

iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mDarkIntensity:F

float-to-int v2, v2

if-eq v1, v2, :cond_exit

int-to-float v1, v1

iput v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mDarkIntensity:F

#####

    #iput p1, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mDarkIntensity:F  ### remove this line

    invoke-static {}, Landroid/animation/ArgbEvaluator;->getInstance()Landroid/animation/ArgbEvaluator;

    move-result-object v0

    iget v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mLightModeIconColorSingleTone:I

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    iget v2, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mDarkModeIconColorSingleTone:I

    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

iget v3, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mDarkIntensity:F  ### add this line

    #invoke-virtual {v0, p1, v1, v2}, Landroid/animation/ArgbEvaluator;->evaluate(FLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ### remove this line

invoke-virtual {v0, v3, v1, v2}, Landroid/animation/ArgbEvaluator;->evaluate(FLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; #### add this line

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v0

    iput v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mIconTint:I 

    iget-object v0, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mNotificationIconAreaController:Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;

    iget v1, p0, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->mIconTint:I

    invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/NotificationIconAreaController;->setIconTint(I)V

    invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBarIconController;->applyIconTint()V

:cond_exit  ### add this line

    return-void
.end method


You can check what i mean easily. If you do not do this change

Código:
  #invoke-virtual {v0, p1, v1, v2}, Landroid/animation/ArgbEvaluator;->evaluate(FLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ### remove this line

invoke-virtual {v0, v3, v1, v2}, Landroid/animation/ArgbEvaluator;->evaluate(FLjava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; #### add this line

Your icons will appear grey when going from light to dark background. We are avoiding 2 tinting (lot of instructions involved) calls with this little hack
[-] Recuento: 8 usuarios dicen Me Gusta a Grouxho por este post:
  • Zerhiote (02-13-2018), Trancoss2 (02-10-2018), fivanbe (02-10-2018), necrosauron (02-09-2018), dav88 (02-09-2018), GVM (02-09-2018), Zonik (02-09-2018), jiterron (02-09-2018)
Responder
#2
Pero que bueno, hay que probarlo. Gracias Grouxho  Clapping
[Imagen: qeHcSFg.png]

Responder
#3
coño @Grouxho !!!! a toda raja el mod... vamos a ver  se siente el ahorro..... saludos
[Imagen: D0YqJ3J.gif]
Responder
#4
A ver no vais a notar nada pero lo que aseguro es que se ahorran un montón de instrucciones. Pero claro, es que colorear los iconitos pequeñitos de la sb tampoco lleva tanta batería, pero... todo suma
[-] Recuento: 1 usuario dice Me Gusta a Grouxho por este post:
  • thereassaad (02-10-2018)
Responder
#5
Ahorras por aquí...puedes pintar por allá..

Sent from my SM-G935F using Tapatalk
[-] Recuento: 2 usuarios dicen Me Gusta a Grouxho por este post:
  • thereassaad (02-10-2018), GVM (02-10-2018)
Responder
#6
Que gran mod. Ahora a ver si aprendo implementarlo.
Gracias grauhxo po este gran trabajo.

Enviado desde mi SM-G935F mediante Tapatalk
[-] Recuento: 1 usuario dice Me Gusta a Trancoss2 por este post:
  • Grouxho (02-10-2018)
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)