Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6847846 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

First pass at new device policy and administration APIs.

This adds new DevicAdmin, DevicePolicyManager, and DeviceAdminInfo classes.
See the java docs for each on documentation on them.  Basically: a DeviceAdmin
is what you derive from to administer a device; DevicePolicyManager is what you
use to apply and check your policy requirements and perform other administration
tasks.
parent 5fbf4094
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ LOCAL_SRC_FILES += \
	core/java/android/app/IActivityWatcher.aidl \
	core/java/android/app/IAlarmManager.aidl \
	core/java/android/app/IBackupAgent.aidl \
    core/java/android/app/IDevicePolicyManager.aidl \
	core/java/android/app/IInstrumentationWatcher.aidl \
	core/java/android/app/INotificationManager.aidl \
	core/java/android/app/ISearchManager.aidl \
+705 −78

File changed.

Preview size limit exceeded, changes collapsed.

+13 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ class ApplicationContext extends Context {
    private boolean mRestricted;
    private AccountManager mAccountManager; // protected by mSync
    private DropBoxManager mDropBoxManager = null;
    private DevicePolicyManager mDevicePolicyManager = null;

    private final Object mSync = new Object();

@@ -895,6 +896,8 @@ class ApplicationContext extends Context {
            return getWallpaperManager();
        } else if (DROPBOX_SERVICE.equals(name)) {
            return getDropBoxManager();
        } else if (DEVICE_POLICY_SERVICE.equals(name)) {
            return getDevicePolicyManager();
        }

        return null;
@@ -1064,6 +1067,16 @@ class ApplicationContext extends Context {
        return mDropBoxManager;
    }

    private DevicePolicyManager getDevicePolicyManager() {
        synchronized (mSync) {
            if (mDevicePolicyManager == null) {
                mDevicePolicyManager = new DevicePolicyManager(this,
                        mMainThread.getHandler());
            }
        }
        return mDevicePolicyManager;
    }

    @Override
    public int checkPermission(String permission, int pid, int uid) {
        if (permission == null) {
+221 −0

File added.

Preview size limit exceeded, changes collapsed.

+186 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading