• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stop package installation

 
rashmi swamy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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?

Thanks,
Rashmi
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are broadcasts that flag successful installation of a new package but I am not sure if there are public APIs for flagging "installation-in-progress status".
 
rashmi swamy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for fast reply. Yes I have checked the broadcast intent for Successful Package installation. But I want stop it if its in progress. This I am trying to stop the market applications installation. Or can you please tell How can I stop the download from market app.

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would this achieve that removing the package after the installation has completed -manually or programmatically- wouldn't achieve? What kind of code is this that would block -in effect countermand- a presumably user-initiated action?
 
rashmi swamy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
rashmi swamy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me explain this with more details.
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.



 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic