use of android.content.pm.ParceledListSlice in project android_frameworks_base by AOSPA.
the class PackageInstallerService method getAllSessions.
@Override
public ParceledListSlice<SessionInfo> getAllSessions(int userId) {
mPm.enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "getAllSessions");
final List<SessionInfo> result = new ArrayList<>();
synchronized (mSessions) {
for (int i = 0; i < mSessions.size(); i++) {
final PackageInstallerSession session = mSessions.valueAt(i);
if (session.userId == userId) {
result.add(session.generateInfo());
}
}
}
return new ParceledListSlice<>(result);
}
use of android.content.pm.ParceledListSlice in project android_packages_apps_Settings by omnirom.
the class ZenAccessSettings method getPackagesRequestingNotificationPolicyAccess.
private ArraySet<String> getPackagesRequestingNotificationPolicyAccess() {
ArraySet<String> requestingPackages = new ArraySet<>();
try {
final String[] PERM = { android.Manifest.permission.ACCESS_NOTIFICATION_POLICY };
final ParceledListSlice list = AppGlobals.getPackageManager().getPackagesHoldingPermissions(PERM, 0, /*flags*/
ActivityManager.getCurrentUser());
final List<PackageInfo> pkgs = list.getList();
if (pkgs != null) {
for (PackageInfo info : pkgs) {
requestingPackages.add(info.packageName);
}
}
} catch (RemoteException e) {
Log.e(TAG, "Cannot reach packagemanager", e);
}
return requestingPackages;
}
use of android.content.pm.ParceledListSlice in project android_packages_apps_Settings by crdroidandroid.
the class ZenAccessSettings method getPackagesRequestingNotificationPolicyAccess.
private ArraySet<String> getPackagesRequestingNotificationPolicyAccess() {
ArraySet<String> requestingPackages = new ArraySet<>();
try {
final String[] PERM = { android.Manifest.permission.ACCESS_NOTIFICATION_POLICY };
final ParceledListSlice list = AppGlobals.getPackageManager().getPackagesHoldingPermissions(PERM, 0, /*flags*/
ActivityManager.getCurrentUser());
final List<PackageInfo> pkgs = list.getList();
if (pkgs != null) {
for (PackageInfo info : pkgs) {
requestingPackages.add(info.packageName);
}
}
} catch (RemoteException e) {
Log.e(TAG, "Cannot reach packagemanager", e);
}
return requestingPackages;
}
use of android.content.pm.ParceledListSlice in project android_packages_apps_Settings by SudaMod.
the class ZenAccessSettings method getPackagesRequestingNotificationPolicyAccess.
private ArraySet<String> getPackagesRequestingNotificationPolicyAccess() {
ArraySet<String> requestingPackages = new ArraySet<>();
try {
final String[] PERM = { android.Manifest.permission.ACCESS_NOTIFICATION_POLICY };
final ParceledListSlice list = AppGlobals.getPackageManager().getPackagesHoldingPermissions(PERM, 0, /*flags*/
ActivityManager.getCurrentUser());
final List<PackageInfo> pkgs = list.getList();
if (pkgs != null) {
for (PackageInfo info : pkgs) {
requestingPackages.add(info.packageName);
}
}
} catch (RemoteException e) {
Log.e(TAG, "Cannot reach packagemanager", e);
}
return requestingPackages;
}
use of android.content.pm.ParceledListSlice in project android_packages_apps_Settings by DirtyUnicorns.
the class ZenAccessSettings method getPackagesRequestingNotificationPolicyAccess.
private ArraySet<String> getPackagesRequestingNotificationPolicyAccess() {
ArraySet<String> requestingPackages = new ArraySet<>();
try {
final String[] PERM = { android.Manifest.permission.ACCESS_NOTIFICATION_POLICY };
final ParceledListSlice list = AppGlobals.getPackageManager().getPackagesHoldingPermissions(PERM, 0, /*flags*/
ActivityManager.getCurrentUser());
final List<PackageInfo> pkgs = list.getList();
if (pkgs != null) {
for (PackageInfo info : pkgs) {
requestingPackages.add(info.packageName);
}
}
} catch (RemoteException e) {
Log.e(TAG, "Cannot reach packagemanager", e);
}
return requestingPackages;
}
Aggregations