Loading core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -41,4 +41,5 @@ interface ITrustManager { void unlockedByBiometricForUser(int userId, in BiometricSourceType source); void clearAllBiometricRecognized(in BiometricSourceType target, int unlockedUser); boolean isActiveUnlockRunning(int userId); boolean isInSignificantPlace(); } core/java/android/app/trust/TrustManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,20 @@ public class TrustManager { } } /** * Returns true if the device is currently in a significant place, and false in all other * circumstances. * * @hide */ public boolean isInSignificantPlace() { try { return mService.isInSignificantPlace(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } private final Handler mHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { Loading core/java/android/security/flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,13 @@ flag { is_fixed_read_only: true } flag { name: "significant_places" namespace: "biometrics" description: "Enabled significant place monitoring" bug: "337870680" } flag { name: "report_primary_auth_attempts" namespace: "biometrics" Loading services/core/java/com/android/server/trust/TrustManagerService.java +48 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.app.AlarmManager.OnAlarmListener; import android.app.admin.DevicePolicyManager; import android.app.trust.ITrustListener; import android.app.trust.ITrustManager; import android.app.trust.TrustManager; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; Loading @@ -47,6 +48,8 @@ import android.hardware.biometrics.BiometricSourceType; import android.hardware.biometrics.SensorProperties; import android.hardware.face.FaceManager; import android.hardware.fingerprint.FingerprintManager; import android.hardware.location.ISignificantPlaceProvider; import android.hardware.location.ISignificantPlaceProviderManager; import android.os.Binder; import android.os.Build; import android.os.Bundle; Loading Loading @@ -83,6 +86,8 @@ import com.android.internal.infra.AndroidFuture; import com.android.internal.util.DumpUtils; import com.android.internal.widget.LockPatternUtils; import com.android.server.SystemService; import com.android.server.servicewatcher.CurrentUserServiceSupplier; import com.android.server.servicewatcher.ServiceWatcher; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -248,6 +253,9 @@ public class TrustManagerService extends SystemService { private boolean mTrustAgentsCanRun = false; private int mCurrentUser = UserHandle.USER_SYSTEM; private ServiceWatcher mSignificantPlaceServiceWatcher; private volatile boolean mIsInSignificantPlace = false; /** * A class for providing dependencies to {@link TrustManagerService} in both production and test * cases. Loading Loading @@ -310,6 +318,38 @@ public class TrustManagerService extends SystemService { mTrustAgentsCanRun = true; refreshAgentList(UserHandle.USER_ALL); refreshDeviceLockedForUser(UserHandle.USER_ALL); if (android.security.Flags.significantPlaces()) { mSignificantPlaceServiceWatcher = ServiceWatcher.create(mContext, TAG, CurrentUserServiceSupplier.create( mContext, TrustManager.ACTION_BIND_SIGNIFICANT_PLACE_PROVIDER, null, null, null), new ServiceWatcher.ServiceListener<>() { @Override public void onBind(IBinder binder, CurrentUserServiceSupplier.BoundServiceInfo service) throws RemoteException { ISignificantPlaceProvider.Stub.asInterface(binder) .setSignificantPlaceProviderManager( new ISignificantPlaceProviderManager.Stub() { @Override public void setInSignificantPlace( boolean inSignificantPlace) { mIsInSignificantPlace = inSignificantPlace; } }); } @Override public void onUnbind() { mIsInSignificantPlace = false; } }); mSignificantPlaceServiceWatcher.register(); } } else if (phase == SystemService.PHASE_BOOT_COMPLETED) { maybeEnableFactoryTrustAgents(UserHandle.USER_SYSTEM); } Loading Loading @@ -1651,6 +1691,11 @@ public class TrustManagerService extends SystemService { } } @Override public boolean isInSignificantPlace() { return mIsInSignificantPlace; } private void enforceReportPermission() { mContext.enforceCallingOrSelfPermission( Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE, "reporting trust events"); Loading Loading @@ -1680,6 +1725,9 @@ public class TrustManagerService extends SystemService { for (UserInfo user : userInfos) { dumpUser(fout, user, user.id == mCurrentUser); } if (mSignificantPlaceServiceWatcher != null) { mSignificantPlaceServiceWatcher.dump(fout); } } }, 1500); } Loading Loading
core/java/android/app/trust/ITrustManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -41,4 +41,5 @@ interface ITrustManager { void unlockedByBiometricForUser(int userId, in BiometricSourceType source); void clearAllBiometricRecognized(in BiometricSourceType target, int unlockedUser); boolean isActiveUnlockRunning(int userId); boolean isInSignificantPlace(); }
core/java/android/app/trust/TrustManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,20 @@ public class TrustManager { } } /** * Returns true if the device is currently in a significant place, and false in all other * circumstances. * * @hide */ public boolean isInSignificantPlace() { try { return mService.isInSignificantPlace(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } private final Handler mHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { Loading
core/java/android/security/flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,13 @@ flag { is_fixed_read_only: true } flag { name: "significant_places" namespace: "biometrics" description: "Enabled significant place monitoring" bug: "337870680" } flag { name: "report_primary_auth_attempts" namespace: "biometrics" Loading
services/core/java/com/android/server/trust/TrustManagerService.java +48 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.app.AlarmManager.OnAlarmListener; import android.app.admin.DevicePolicyManager; import android.app.trust.ITrustListener; import android.app.trust.ITrustManager; import android.app.trust.TrustManager; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; Loading @@ -47,6 +48,8 @@ import android.hardware.biometrics.BiometricSourceType; import android.hardware.biometrics.SensorProperties; import android.hardware.face.FaceManager; import android.hardware.fingerprint.FingerprintManager; import android.hardware.location.ISignificantPlaceProvider; import android.hardware.location.ISignificantPlaceProviderManager; import android.os.Binder; import android.os.Build; import android.os.Bundle; Loading Loading @@ -83,6 +86,8 @@ import com.android.internal.infra.AndroidFuture; import com.android.internal.util.DumpUtils; import com.android.internal.widget.LockPatternUtils; import com.android.server.SystemService; import com.android.server.servicewatcher.CurrentUserServiceSupplier; import com.android.server.servicewatcher.ServiceWatcher; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -248,6 +253,9 @@ public class TrustManagerService extends SystemService { private boolean mTrustAgentsCanRun = false; private int mCurrentUser = UserHandle.USER_SYSTEM; private ServiceWatcher mSignificantPlaceServiceWatcher; private volatile boolean mIsInSignificantPlace = false; /** * A class for providing dependencies to {@link TrustManagerService} in both production and test * cases. Loading Loading @@ -310,6 +318,38 @@ public class TrustManagerService extends SystemService { mTrustAgentsCanRun = true; refreshAgentList(UserHandle.USER_ALL); refreshDeviceLockedForUser(UserHandle.USER_ALL); if (android.security.Flags.significantPlaces()) { mSignificantPlaceServiceWatcher = ServiceWatcher.create(mContext, TAG, CurrentUserServiceSupplier.create( mContext, TrustManager.ACTION_BIND_SIGNIFICANT_PLACE_PROVIDER, null, null, null), new ServiceWatcher.ServiceListener<>() { @Override public void onBind(IBinder binder, CurrentUserServiceSupplier.BoundServiceInfo service) throws RemoteException { ISignificantPlaceProvider.Stub.asInterface(binder) .setSignificantPlaceProviderManager( new ISignificantPlaceProviderManager.Stub() { @Override public void setInSignificantPlace( boolean inSignificantPlace) { mIsInSignificantPlace = inSignificantPlace; } }); } @Override public void onUnbind() { mIsInSignificantPlace = false; } }); mSignificantPlaceServiceWatcher.register(); } } else if (phase == SystemService.PHASE_BOOT_COMPLETED) { maybeEnableFactoryTrustAgents(UserHandle.USER_SYSTEM); } Loading Loading @@ -1651,6 +1691,11 @@ public class TrustManagerService extends SystemService { } } @Override public boolean isInSignificantPlace() { return mIsInSignificantPlace; } private void enforceReportPermission() { mContext.enforceCallingOrSelfPermission( Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE, "reporting trust events"); Loading Loading @@ -1680,6 +1725,9 @@ public class TrustManagerService extends SystemService { for (UserInfo user : userInfos) { dumpUser(fout, user, user.id == mCurrentUser); } if (mSignificantPlaceServiceWatcher != null) { mSignificantPlaceServiceWatcher.dump(fout); } } }, 1500); } Loading