"About phone" - "Check for updates", a check will begin to se...">

Programmatically checking for Android OTA system updates

If you go to "Settings"> "About phone" - "Check for updates", a check will begin to see if any system updates are ready for your phone.

How can I do this action programmatically? Also, I'm trying to find where in the Android source code this happens, so I can see it completely and understand it better. Anyone have any suggestions?

+5
source share
1 answer

As far as I know, there are no known translations, intentions or APIs for software programming.

And it depends on the ROM and the manufacturer.

Sony, , , , Wi-Fi , Sony .

AOSP, .

packages/apps/Settings/src/com/android/settings/DeviceInfoSettings.java

Protip: grep " " res/values , !

Edit:

:

public class SystemUpdateClass extends BroadcastReceiver{
   @Override
   public void onReceive(Context context, Intent intent){
      if (intent.getAction().equals("android.settings.SYSTEM_UPDATE_SETTINGS")){
           Toast.makeText(context, 
                 "Yup! Received a system update broadcast", 
                 Toast.LENGTH_SHORT).show();
      }
   }
}

, onCreate:

SystemUpdateClass sysUpdate = new SystemUpdateClass();
IntentFilter filter = new IntentFilter();
filter.addAction("android.settings.SYSTEM_UPDATE_SETTINGS");
registerReceiver(sysUpdate, filter);

, , , , ... :)

+7

All Articles