Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Added restriction getInstalledProvidersForProfile
Browse files Browse the repository at this point in the history
Refs #1757
  • Loading branch information
M66B committed Dec 14, 2014
1 parent 674cc94 commit d13262f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Changelog
* Added restriction *Srv_getAccountsForPackage*
* Added account type parameter for *Srv_getAccounts* and *Srv_getAccountsAsUser*
* Check external storage directory for *open* restriction ([issue](/../../issues/1757))
* Added restriction *getInstalledProvidersForProfile* ([issue](/../../issues/1757))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

Expand Down
1 change: 1 addition & 0 deletions res/values/functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
<string name="system_Srv_queryIntentServices" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/content/pm/PackageManager.html#queryIntentServices(android.content.Intent,%20int)">Google documentation</a>]]></string>
<string name="system_Srv_getPersistentApplications" translatable="false"><![CDATA[<a href="https://developer.android.com/guide/topics/manifest/application-element.html#persistent">Google documentation</a>]]></string>
<string name="system_getInstalledProviders" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/appwidget/AppWidgetManager.html#getInstalledProviders()">Google documentation</a>]]></string>
<string name="system_getInstalledProvidersForProfile" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/appwidget/AppWidgetManager.html#getInstalledProvidersForProfile(android.os.UserHandle)">Google documentation</a>]]></string>
<string name="system_Srv_getInstalledProviders" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/appwidget/AppWidgetManager.html#getInstalledProviders()">Google documentation</a>]]></string>
<string name="system_getRecentTasks" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/app/ActivityManager.html#getRecentTasks(int,%20int)">Google documentation</a>]]></string>
<string name="system_getRunningAppProcesses" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/app/ActivityManager.html#getRunningAppProcesses()">Google documentation</a>]]></string>
Expand Down
1 change: 1 addition & 0 deletions src/biz/bokhorst/xprivacy/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ public static List<Hook> get() {
mListHook.add(new Hook("system", "Srv_queryIntentServices", "", 19, "2.99", "queryIntentServices").AOSP(19).dangerous());

mListHook.add(new Hook("system", "getInstalledProviders", "", 3, null, null).notAOSP(19).dangerous());
mListHook.add(new Hook("system", "getInstalledProvidersForProfile", "", 21, "3.5.6", null).notAOSP(21).dangerous());
mListHook.add(new Hook("system", "Srv_getInstalledProviders", "", 3, "2.99", "getInstalledProviders").AOSP(19).dangerous());

mListHook.add(new Hook("system", "getRecentTasks", "GET_TASKS", 1, null, null).notAOSP(19).dangerous());
Expand Down
5 changes: 4 additions & 1 deletion src/biz/bokhorst/xprivacy/XAppWidgetManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public String getClassName() {
// @formatter:off

// public List<AppWidgetProviderInfo> getInstalledProviders()
// public List<AppWidgetProviderInfo> getInstalledProvidersForProfile(UserHandle profile)
// frameworks/base/core/java/android/appwidget/AppWidgetManager.java
// http://developer.android.com/reference/android/appwidget/AppWidgetManager.html

Expand All @@ -34,12 +35,13 @@ public String getClassName() {
// @formatter:on

private enum Methods {
getInstalledProviders, Srv_getInstalledProviders
getInstalledProviders, getInstalledProvidersForProfile, Srv_getInstalledProviders
};

public static List<XHook> getInstances() {
List<XHook> listHook = new ArrayList<XHook>();
listHook.add(new XAppWidgetManager(Methods.getInstalledProviders, PrivacyManager.cSystem));
listHook.add(new XAppWidgetManager(Methods.getInstalledProvidersForProfile, PrivacyManager.cSystem));
listHook.add(new XAppWidgetManager(Methods.Srv_getInstalledProviders, PrivacyManager.cSystem));
return listHook;
}
Expand All @@ -53,6 +55,7 @@ protected void before(XParam param) throws Throwable {
protected void after(XParam param) throws Throwable {
switch (mMethod) {
case getInstalledProviders:
case getInstalledProvidersForProfile:
case Srv_getInstalledProviders:
if (param.getResult() != null)
if (isRestricted(param))
Expand Down

0 comments on commit d13262f

Please sign in to comment.