check if installed apps are enabled
This commit is contained in:
parent
60a822a218
commit
e80c3bf162
|
@ -728,18 +728,15 @@ public class Orbot extends ActionBarActivity implements TorConstants, OnLongClic
|
||||||
private boolean appInstalledOrNot(String uri)
|
private boolean appInstalledOrNot(String uri)
|
||||||
{
|
{
|
||||||
PackageManager pm = getPackageManager();
|
PackageManager pm = getPackageManager();
|
||||||
boolean app_installed = false;
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PackageInfo pi = pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
|
PackageInfo pi = pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
|
||||||
|
return pi.applicationInfo.enabled;
|
||||||
app_installed = true;
|
|
||||||
}
|
}
|
||||||
catch (PackageManager.NameNotFoundException e)
|
catch (PackageManager.NameNotFoundException e)
|
||||||
{
|
{
|
||||||
app_installed = false;
|
return false;
|
||||||
}
|
}
|
||||||
return app_installed ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue