Loading core/java/android/app/KeyguardManager.java +16 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.RequiresPermission; import android.app.trust.ITrustManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.UserInfo; import android.os.Binder; import android.os.RemoteException; Loading @@ -45,6 +46,7 @@ public class KeyguardManager { private IWindowManager mWM; private ITrustManager mTrustManager; private IUserManager mUserManager; private Context mContext; /** * Intent used to prompt user for device credentials. Loading Loading @@ -87,8 +89,12 @@ public class KeyguardManager { Intent intent = new Intent(ACTION_CONFIRM_DEVICE_CREDENTIAL); intent.putExtra(EXTRA_TITLE, title); intent.putExtra(EXTRA_DESCRIPTION, description); if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) { intent.setPackage("com.google.android.apps.wearable.settings"); } else { // For security reasons, only allow this to come from system settings. intent.setPackage("com.android.settings"); } return intent; } Loading @@ -109,8 +115,12 @@ public class KeyguardManager { intent.putExtra(EXTRA_TITLE, title); intent.putExtra(EXTRA_DESCRIPTION, description); intent.putExtra(Intent.EXTRA_USER_ID, userId); if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) { intent.setPackage("com.google.android.apps.wearable.settings"); } else { // For security reasons, only allow this to come from system settings. intent.setPackage("com.android.settings"); } return intent; } Loading Loading @@ -193,7 +203,8 @@ public class KeyguardManager { } KeyguardManager() throws ServiceNotFoundException { KeyguardManager(Context context) throws ServiceNotFoundException { mContext = context; mWM = WindowManagerGlobal.getWindowManagerService(); mTrustManager = ITrustManager.Stub.asInterface( ServiceManager.getServiceOrThrow(Context.TRUST_SERVICE)); Loading core/java/android/app/SystemServiceRegistry.java +3 −3 Original line number Diff line number Diff line Loading @@ -322,10 +322,10 @@ final class SystemServiceRegistry { }}); registerService(Context.KEYGUARD_SERVICE, KeyguardManager.class, new StaticServiceFetcher<KeyguardManager>() { new CachedServiceFetcher<KeyguardManager>() { @Override public KeyguardManager createService() throws ServiceNotFoundException { return new KeyguardManager(); public KeyguardManager createService(ContextImpl ctx) throws ServiceNotFoundException { return new KeyguardManager(ctx); }}); registerService(Context.LAYOUT_INFLATER_SERVICE, LayoutInflater.class, Loading Loading
core/java/android/app/KeyguardManager.java +16 −5 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.RequiresPermission; import android.app.trust.ITrustManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.UserInfo; import android.os.Binder; import android.os.RemoteException; Loading @@ -45,6 +46,7 @@ public class KeyguardManager { private IWindowManager mWM; private ITrustManager mTrustManager; private IUserManager mUserManager; private Context mContext; /** * Intent used to prompt user for device credentials. Loading Loading @@ -87,8 +89,12 @@ public class KeyguardManager { Intent intent = new Intent(ACTION_CONFIRM_DEVICE_CREDENTIAL); intent.putExtra(EXTRA_TITLE, title); intent.putExtra(EXTRA_DESCRIPTION, description); if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) { intent.setPackage("com.google.android.apps.wearable.settings"); } else { // For security reasons, only allow this to come from system settings. intent.setPackage("com.android.settings"); } return intent; } Loading @@ -109,8 +115,12 @@ public class KeyguardManager { intent.putExtra(EXTRA_TITLE, title); intent.putExtra(EXTRA_DESCRIPTION, description); intent.putExtra(Intent.EXTRA_USER_ID, userId); if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)) { intent.setPackage("com.google.android.apps.wearable.settings"); } else { // For security reasons, only allow this to come from system settings. intent.setPackage("com.android.settings"); } return intent; } Loading Loading @@ -193,7 +203,8 @@ public class KeyguardManager { } KeyguardManager() throws ServiceNotFoundException { KeyguardManager(Context context) throws ServiceNotFoundException { mContext = context; mWM = WindowManagerGlobal.getWindowManagerService(); mTrustManager = ITrustManager.Stub.asInterface( ServiceManager.getServiceOrThrow(Context.TRUST_SERVICE)); Loading
core/java/android/app/SystemServiceRegistry.java +3 −3 Original line number Diff line number Diff line Loading @@ -322,10 +322,10 @@ final class SystemServiceRegistry { }}); registerService(Context.KEYGUARD_SERVICE, KeyguardManager.class, new StaticServiceFetcher<KeyguardManager>() { new CachedServiceFetcher<KeyguardManager>() { @Override public KeyguardManager createService() throws ServiceNotFoundException { return new KeyguardManager(); public KeyguardManager createService(ContextImpl ctx) throws ServiceNotFoundException { return new KeyguardManager(ctx); }}); registerService(Context.LAYOUT_INFLATER_SERVICE, LayoutInflater.class, Loading