I want to stop the installation of package under process. I am going through PackageManagerService.java which is responsible for installation. Can you please tell me how does the installation path flows and how can I stop the installation. Is there any observer for installation status?
rashmi swamy wrote:I am doing some research on android market and, I want to manage(block/unblock) Android market app programatically.
That means if I say block android market then , from the android market app downloading/installation must not happen.
Meaning user should be able to start Android Market(client app on every phone). But not install/download any app?
If so, isn't that like controlling the way other app(Android market) behaves from within your app?
Wouldn't the safe way to do this would be to ask the user to not use Android market or uninstall it?
As part of my research, I am writing a device administrator kind of thing, similar on lines of active sync provisioning we have in windows mobiles. Where there will be certain policies sent by the administrator. The use case goes as follows.
Device administrator sends the policies to wipe the phone memory on theft of the phone. So that unauthorized user cant access my data on the phone. Similarly I want to have a control on the usage of Android Market App.
1. If the device administrator blocks the usage of market app, the user should not be able to launch the android market.
2. In case the market app is launched and app is being downloaded/installing and during this process of downloading/installing the app, the Device administrator blocks the usage of market app, then it should stop downloading/installation immediately.
what we tried :
1. We tried clearing the data of market app while download is ongoing by using the clearApplicationUserData API in ActivityManager Class
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
boolean res = am.clearApplicationUserData("com.android.vending", new ClearUserDataObserver());
Result : It shows the Download is in progress , but once the download completes . it will not install the package.i have checked that in the file system the apk is not present.so in this case user may be charged for the downloading the app which cant be installed. this will be unfair to the user.so how can i stop the download itself.similarly how do i handle the case of installation in progress of the market app and then try to stop it ?
your inputs to this will very helpful
rashmi swamy wrote:2. In case the market app is launched and app is being downloaded/installing and during this process of downloading/installing the app, the Device administrator blocks the usage of market app, then it should stop downloading/installation immediately.
Again: Why? What does this achieve that removing the package after installation does not achieve?