summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4ee5d5d)
This is to make sure the unit test can mock them out.
Bug:
26911599
Change-Id: I07a1a8b43ad5716a4b667bc5266b3b03997268c5
void securityLogSetLoggingEnabledProperty(boolean enabled) {
SecurityLog.setLoggingEnabledProperty(enabled);
}
void securityLogSetLoggingEnabledProperty(boolean enabled) {
SecurityLog.setLoggingEnabledProperty(enabled);
}
+
+ boolean securityLogGetLoggingEnabledProperty() {
+ return SecurityLog.getLoggingEnabledProperty();
+ }
+
+ boolean securityLogIsLoggingEnabled() {
+ return SecurityLog.isLoggingEnabled();
+ }
if (mOwners.hasDeviceOwner()) {
mInjector.systemPropertiesSet(PROPERTY_DEVICE_OWNER_PRESENT, "true");
disableDeviceLoggingIfNotCompliant();
if (mOwners.hasDeviceOwner()) {
mInjector.systemPropertiesSet(PROPERTY_DEVICE_OWNER_PRESENT, "true");
disableDeviceLoggingIfNotCompliant();
- if (SecurityLog.getLoggingEnabledProperty()) {
+ if (mInjector.securityLogGetLoggingEnabledProperty()) {
mSecurityLogMonitor.start();
}
} else {
mSecurityLogMonitor.start();
}
} else {
mInjector.binderRestoreCallingIdentity(ident);
}
mInjector.binderRestoreCallingIdentity(ident);
}
- if (SecurityLog.isLoggingEnabled()) {
+ if (mInjector.securityLogIsLoggingEnabled()) {
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT, /*result*/ 0);
}
}
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT, /*result*/ 0);
}
}
- if (SecurityLog.isLoggingEnabled()) {
+ if (mInjector.securityLogIsLoggingEnabled()) {
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT, /*result*/ 1);
}
}
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT, /*result*/ 1);
}
}
public void reportKeyguardDismissed() {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.BIND_DEVICE_ADMIN, null);
public void reportKeyguardDismissed() {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.BIND_DEVICE_ADMIN, null);
- if (SecurityLog.isLoggingEnabled()) {
+ if (mInjector.securityLogIsLoggingEnabled()) {
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISMISSED);
}
}
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_DISMISSED);
}
}
public void reportKeyguardSecured() {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.BIND_DEVICE_ADMIN, null);
public void reportKeyguardSecured() {
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.BIND_DEVICE_ADMIN, null);
- if (SecurityLog.isLoggingEnabled()) {
+ if (mInjector.securityLogIsLoggingEnabled()) {
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_SECURED);
}
}
SecurityLog.writeEvent(SecurityLog.TAG_KEYGUARD_SECURED);
}
}
Preconditions.checkNotNull(admin);
synchronized (this) {
getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
Preconditions.checkNotNull(admin);
synchronized (this) {
getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
- return SecurityLog.getLoggingEnabledProperty();
+ return mInjector.securityLogGetLoggingEnabledProperty();
void securityLogSetLoggingEnabledProperty(boolean enabled) {
context.settings.securityLogSetLoggingEnabledProperty(enabled);
}
void securityLogSetLoggingEnabledProperty(boolean enabled) {
context.settings.securityLogSetLoggingEnabledProperty(enabled);
}
+
+ @Override
+ boolean securityLogGetLoggingEnabledProperty() {
+ return context.settings.securityLogGetLoggingEnabledProperty();
+ }
+
+ @Override
+ boolean securityLogIsLoggingEnabled() {
+ return context.settings.securityLogIsLoggingEnabled();
+ }
void securityLogSetLoggingEnabledProperty(boolean enabled) {
}
void securityLogSetLoggingEnabledProperty(boolean enabled) {
}
+
+ public boolean securityLogGetLoggingEnabledProperty() {
+ return false;
+ }
+
+ public boolean securityLogIsLoggingEnabled() {
+ return false;
+ }
}
public final Context realTestContext;
}
public final Context realTestContext;