private final Context mContext;
private final IDevicePolicyManager mService;
- // TODO Use it everywhere.
private static final String REMOTE_EXCEPTION_MESSAGE =
"Failed to talk with device policy manager service";
try {
return mService.isAdminActive(admin, userId);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.isRemovingAdmin(admin, userId);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.getActiveAdmins(userId);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
return mService.packageHasActiveAdmins(packageName, myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.removeActiveAdmin(admin, myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.hasGrantedPolicy(admin, usesPolicy, myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.setPasswordQuality(admin, quality);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordQuality(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return PASSWORD_QUALITY_UNSPECIFIED;
try {
mService.setPasswordMinimumLength(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordMinimumLength(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setPasswordMinimumUpperCase(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordMinimumUpperCase(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setPasswordMinimumLowerCase(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordMinimumLowerCase(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setPasswordMinimumLetters(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordMinimumLetters(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setPasswordMinimumNumeric(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordMinimumNumeric(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setPasswordMinimumSymbols(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordMinimumSymbols(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setPasswordMinimumNonLetter(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordMinimumNonLetter(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setPasswordHistoryLength(admin, length);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setPasswordExpirationTimeout(admin, timeout);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getPasswordExpirationTimeout(admin, myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
return mService.getPasswordExpiration(admin, myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
return mService.getPasswordHistoryLength(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
return mService.isActivePasswordSufficient(myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.getCurrentFailedPasswordAttempts(myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return -1;
try {
return mService.getDoNotAskCredentialsOnBoot();
} catch (RemoteException e) {
- Log.w(TAG, "Failed to call getDoNotAskCredentialsOnBoot()", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.setMaximumFailedPasswordsForWipe(admin, num);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getMaximumFailedPasswordsForWipe(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
return mService.getProfileWithMinimumFailedPasswordsForWipe(userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return UserHandle.USER_NULL;
try {
return mService.resetPassword(password, flags);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.setMaximumTimeToLock(admin, timeMs);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getMaximumTimeToLock(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.lockNow();
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.wipeData(flags);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
}
return mService.setGlobalProxy(admin, hostSpec, exclSpec);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
mService.setRecommendedGlobalProxy(admin, proxyInfo);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getGlobalProxyAdmin(myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
return mService.setStorageEncryption(admin, encrypt);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return ENCRYPTION_STATUS_UNSUPPORTED;
try {
return mService.getStorageEncryption(admin, myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.getStorageEncryptionStatus(userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return ENCRYPTION_STATUS_UNSUPPORTED;
try {
return mService.installCaCert(admin, certBuffer);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
} catch (CertificateException e) {
Log.w(TAG, "Unable to parse certificate", e);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
}
}
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return certs;
mService.uninstallCaCerts(admin, new TrustedCertificateStore().userAliases()
.toArray(new String[0]));
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
mService.enforceCanManageCaCerts(admin);
return getCaCertAlias(certBuffer) != null;
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
} catch (CertificateException ce) {
Log.w(TAG, "Could not parse certificate", ce);
}
.getKeySpec(privKey, PKCS8EncodedKeySpec.class).getEncoded();
return mService.installKeyPair(admin, pkcs8Key, pemCert, alias);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
} catch (NoSuchAlgorithmException | InvalidKeySpecException e) {
Log.w(TAG, "Failed to obtain private key material", e);
} catch (CertificateException | IOException e) {
try {
mService.setCertInstallerPackage(admin, installerPackage);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getCertInstallerPackage(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
mService.setCameraDisabled(admin, disabled);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getCameraDisabled(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.setScreenCaptureDisabled(admin, disabled);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getScreenCaptureDisabled(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.setAutoTimeRequired(admin, required);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getAutoTimeRequired();
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.setKeyguardDisabledFeatures(admin, which);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getKeyguardDisabledFeatures(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return KEYGUARD_DISABLE_FEATURES_NONE;
try {
mService.setActiveAdmin(policyReceiver, refreshing, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return new DeviceAdminInfo(mContext, ri);
- } catch (XmlPullParserException e) {
- Log.w(TAG, "Unable to parse device policy " + cn, e);
- return null;
- } catch (IOException e) {
+ } catch (XmlPullParserException | IOException e) {
Log.w(TAG, "Unable to parse device policy " + cn, e);
return null;
}
try {
mService.getRemoveWarning(admin, result, myUserId());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
mService.setActivePasswordState(quality, length, letters, uppercase, lowercase,
numbers, symbols, nonletter, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.reportFailedPasswordAttempt(userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.reportSuccessfulPasswordAttempt(userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.setDeviceOwner(who, ownerName, userId);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to set device owner");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return false;
try {
return mService.getDeviceOwnerComponent(callingUserOnly);
} catch (RemoteException re) {
- Log.w(TAG, REMOTE_EXCEPTION_MESSAGE);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return null;
try {
return mService.getDeviceOwnerUserId();
} catch (RemoteException re) {
- Log.w(TAG, REMOTE_EXCEPTION_MESSAGE);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return UserHandle.USER_NULL;
try {
mService.clearDeviceOwner(packageName);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to clear device owner");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
try {
return mService.getDeviceOwnerName();
} catch (RemoteException re) {
- Log.w(TAG, REMOTE_EXCEPTION_MESSAGE);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return null;
mService.setActiveAdmin(admin, false, myUserId);
return mService.setProfileOwner(admin, ownerName, myUserId);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to set profile owner " + re);
throw new IllegalArgumentException("Couldn't set profile owner.", re);
}
}
try {
mService.clearProfileOwner(admin);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to clear profile owner " + admin + re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
try {
return mService.hasUserSetupCompleted();
} catch (RemoteException re) {
- Log.w(TAG, "Failed to check whether user setup has completed");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return true;
}
return mService.setProfileOwner(admin, ownerName, userHandle);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to set profile owner", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
throw new IllegalArgumentException("Couldn't set profile owner.", re);
}
}
try {
return mService.setDeviceOwnerLockScreenInfo(admin, info);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return false;
try {
return mService.getDeviceOwnerLockScreenInfo();
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return null;
try {
mService.setProfileEnabled(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setProfileName(admin, profileName);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
return profileOwner != null
&& profileOwner.getPackageName().equals(packageName);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to check profile owner");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return false;
try {
return mService.getProfileOwner(userId);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to get profile owner");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
throw new IllegalArgumentException(
"Requested profile owner for invalid userId", re);
}
try {
return mService.getProfileOwnerName(Process.myUserHandle().getIdentifier());
} catch (RemoteException re) {
- Log.w(TAG, "Failed to get profile owner");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
throw new IllegalArgumentException(
"Requested profile owner for invalid userId", re);
}
try {
return mService.getProfileOwnerName(userId);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to get profile owner");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
throw new IllegalArgumentException(
"Requested profile owner for invalid userId", re);
}
try {
mService.addPersistentPreferredActivity(admin, filter, activity);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.clearPackagePersistentPreferredActivities(admin, packageName);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setApplicationRestrictions(admin, packageName, settings);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setTrustAgentConfiguration(admin, target, configuration);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getTrustAgentConfiguration(admin, agent, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return new ArrayList<PersistableBundle>(); // empty list
try {
mService.setCrossProfileCallerIdDisabled(admin, disabled);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getCrossProfileCallerIdDisabled(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.getCrossProfileCallerIdDisabledForUser(userHandle.getIdentifier());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
mService.startManagedQuickContact(
actualLookupKey, actualContactId, directoryId, originalIntent);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setBluetoothContactSharingDisabled(admin, disabled);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getBluetoothContactSharingDisabled(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return true;
return mService.getBluetoothContactSharingDisabledForUser(userHandle
.getIdentifier());
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return true;
try {
mService.addCrossProfileIntentFilter(admin, filter, flags);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.clearCrossProfileIntentFilters(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.setPermittedAccessibilityServices(admin, packageNames);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.getPermittedAccessibilityServices(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
return mService.getPermittedAccessibilityServicesForUser(userId);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
return mService.setPermittedInputMethods(admin, packageNames);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.getPermittedInputMethods(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
return mService.getPermittedInputMethodsForCurrentUser();
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
return mService.getKeepUninstalledPackages(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
mService.setKeepUninstalledPackages(admin, packageNames);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.createUser(admin, name);
} catch (RemoteException re) {
- Log.w(TAG, "Could not create a user", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
return null;
}
return mService.createAndInitializeUser(admin, name, ownerName, profileOwnerComponent,
adminExtras);
} catch (RemoteException re) {
- Log.w(TAG, "Could not create a user", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
return null;
}
try {
return mService.removeUser(admin, userHandle);
} catch (RemoteException re) {
- Log.w(TAG, "Could not remove user ", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
return mService.switchUser(admin, userHandle);
} catch (RemoteException re) {
- Log.w(TAG, "Could not switch user ", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
return mService.getApplicationRestrictions(admin, packageName);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
mService.setUserRestriction(admin, key, true);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setUserRestriction(admin, key, false);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
ret = mService.getUserRestrictions(admin, userHandle);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return ret == null ? new Bundle() : ret;
try {
return mService.setApplicationHidden(admin, packageName, hidden);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
return mService.isApplicationHidden(admin, packageName);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.enableSystemApp(admin, packageName);
} catch (RemoteException e) {
- Log.w(TAG, "Failed to install package: " + packageName);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.enableSystemAppWithIntent(admin, intent);
} catch (RemoteException e) {
- Log.w(TAG, "Failed to install packages matching filter: " + intent);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return 0;
try {
mService.setAccountManagementDisabled(admin, accountType, disabled);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getAccountTypesWithManagementDisabledAsUser(userId);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
try {
mService.setLockTaskPackages(admin, packages);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
return mService.getLockTaskPackages(admin);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return null;
try {
return mService.isLockTaskPermitted(pkg);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
return false;
try {
mService.setGlobalSetting(admin, setting, value);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setSecureSetting(admin, setting, value);
} catch (RemoteException e) {
- Log.w(TAG, "Failed talking with device policy service", e);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, e);
}
}
}
try {
mService.setRestrictionsProvider(admin, provider);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to set permission provider on device policy service");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
try {
mService.setMasterVolumeMuted(admin, on);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to setMasterMute on device policy service");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
try {
return mService.isMasterVolumeMuted(admin);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to get isMasterMute on device policy service");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return false;
try {
mService.setUninstallBlocked(admin, packageName, uninstallBlocked);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to call block uninstall on device policy service");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
try {
return mService.isUninstallBlocked(admin, packageName);
} catch (RemoteException re) {
- Log.w(TAG, "Failed to call block uninstall on device policy service");
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return false;
try {
return mService.addCrossProfileWidgetProvider(admin, packageName);
} catch (RemoteException re) {
- Log.w(TAG, "Error calling addCrossProfileWidgetProvider", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return false;
try {
return mService.removeCrossProfileWidgetProvider(admin, packageName);
} catch (RemoteException re) {
- Log.w(TAG, "Error calling removeCrossProfileWidgetProvider", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return false;
return providers;
}
} catch (RemoteException re) {
- Log.w(TAG, "Error calling getCrossProfileWidgetProviders", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return Collections.emptyList();
try {
mService.setUserIcon(admin, icon);
} catch (RemoteException re) {
- Log.w(TAG, "Could not set the user icon ", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
try {
mService.setSystemUpdatePolicy(admin, policy);
} catch (RemoteException re) {
- Log.w(TAG, "Error calling setSystemUpdatePolicy", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
try {
return mService.getSystemUpdatePolicy();
} catch (RemoteException re) {
- Log.w(TAG, "Error calling getSystemUpdatePolicy", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
return null;
try {
return mService.setKeyguardDisabled(admin, disabled);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
return mService.setStatusBarDisabled(admin, disabled);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
mService.notifyPendingSystemUpdate(updateReceivedTime);
} catch (RemoteException re) {
- Log.w(TAG, "Could not notify device owner about pending system update", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
}
try {
mService.setPermissionPolicy(admin, policy);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
}
}
try {
return mService.setPermissionGrantState(admin, packageName, permission, grantState);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
return mService.getPermissionGrantState(admin, packageName, permission);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return PERMISSION_GRANT_STATE_DEFAULT;
}
}
try {
return mService.isProvisioningAllowed(action);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
return mService.isManagedProfile(admin);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
return mService.isSystemOnlyUser(admin);
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return false;
}
}
try {
return mService.getWifiMacAddress();
} catch (RemoteException re) {
- Log.w(TAG, "Failed talking with device policy service", re);
+ Log.w(TAG, REMOTE_EXCEPTION_MESSAGE, re);
return null;
}
}