I am using Device Policy Manager in my Android App and I have a
problem with Honeycomb devices.  When attempting to call resetPassword
I get an exception thrown.  This is not the case in Froyo or
Gingerbread, as both of those work fine.

The error is:

java.lang.RuntimeException: Unable to start receiver
Package.Name.Test: java.lang.SecurityException: Permission Denial:
writing com.android.providers.settings.SettingsProvider uri
content://settings/secure from pid=x, uid=y requires
android.permission.WRITE_SETTINGS

My Android Code is as follows:

        DevicePolicyManager mDPM = (DevicePolicyManager)
context.getSystemService(Context.DEVICE_POLICY_SERVICE);

        if ((mDPM.getActiveAdmins() != null) && (mDPM.isAdminActive(new
ComponentName(context, DeviceAdmin.class)))) {
                mDPM.resetPassword(extra,
DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
                mDPM.lockNow();
        } else {
                Log.d(TAG, "Could not lock because device admin not enabled");
        }

The problem occurs at:

        mDPM.resetPassword(extra,
DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);

My Device_Admin.xml is:

        <device-admin xmlns:android="http://schemas.android.com/apk/res/
android">
                <uses-policies>
                        <force-lock />
                        <wipe-data />
                        <reset-password />
                </uses-policies>
        </device-admin>

Like I said the device admin works great on Froyo and Gingerbread
devices, although I do have some problems with users using different
keyguards, an example is the Droid X and HTC Sense.  This problem is
with timing.  When I call lockNow the device will turn off the screen
but HTC Sense or MotoBlur will not actually lock the keyguard until
the time that was set in Settings, Security, Lock Phone After.

Any help would be awesome!  I just recently got a honeycomb tablet at
I/O and haven't tested the app out on this device yet, but I see the
errors on the market website with users with the Xoom running 3.0.
Have not seen any 3.1 devices yet.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to