3

I was wondering how hibernating of an app works technically.

I know about freezing an app (shell pm disable com.mypackage.name), but this also hides the app icon from launcher. I want to know how Greenify App works. It disables the app from running in background until I launch it again and then when I exit from that app, Greenify automatically hibernates it.

So my question is how does it do that?

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
Amit Kumar Khare
  • 281
  • 2
  • 4
  • 11

1 Answers1

1

This is a citation from excellent explanation by lioux on XDA:

Greenify uses the Android command am to stop an app and applies this command again if the app is awakened by any action whatsoever. That's what hibernating means. Hibernated app will no longer start during phone boot, respond to registered intents or be triggered by alarms from the system. Everything it does is temporary. The am command does not touch the installed files or any configuration information.

Andrew T.
  • 15,988
  • 10
  • 74
  • 123
jis
  • 549
  • 2
  • 8
  • Sounds cool, I'll let you know if it worked. oh by the way thanks for the reply... :) – Amit Kumar Khare Feb 19 '14 at 19:10
  • 1
    It works wonderfully, but don't greenify blindly everything, but only confirmed CPU/RAM/battery hogs. Use Greenify built in app analyser, Wakelock Detector and Better Battery Stats to identify good candidates for greenifying. – jis Feb 19 '14 at 22:59
  • Forget Greenify! I've made an app out of it. I call it OXYGEN. http://goo.gl/vfyKsv - Light Weight. and takes almost about 2MBs of ram in the background. – Amit Kumar Khare Nov 23 '14 at 10:26
  • @Amit: Why was your app withdrawn from Google Play? – jis Nov 23 '14 at 16:16
  • yes brother. Google does not treat their developers well. – Amit Kumar Khare Dec 07 '14 at 10:18
  • am command did not disable apps, it just stop app from running but some event can still run app again. Greenify is using pm command to freeze apps. – QkiZ Nov 15 '20 at 13:56