Loading core/java/android/os/image/DynamicSystemClient.java +9 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,15 @@ public class DynamicSystemClient { */ public static final String KEY_ONE_SHOT = "KEY_ONE_SHOT"; /** * Intent key: Whether to use default strings when showing the dialog that prompts * user for device credentials. * False indicates using the custom strings provided by {@code DynamicSystem}. * @hide */ public static final String KEY_KEYGUARD_USE_DEFAULT_STRINGS = "KEY_KEYGUARD_USE_DEFAULT_STRINGS"; private static class IncomingHandler extends Handler { private final WeakReference<DynamicSystemClient> mWeakClient; Loading packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java +20 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.dynsystem; import static android.os.image.DynamicSystemClient.KEY_KEYGUARD_USE_DEFAULT_STRINGS; import android.app.Activity; import android.app.KeyguardManager; import android.content.Context; Loading Loading @@ -47,10 +49,7 @@ public class VerificationActivity extends Activity { KeyguardManager km = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); if (km != null) { String title = getString(R.string.keyguard_title); String description = getString(R.string.keyguard_description); Intent intent = km.createConfirmDeviceCredentialIntent(title, description); Intent intent = createConfirmDeviceCredentialIntent(km); if (intent == null) { Log.d(TAG, "This device is not protected by a password/pin"); startInstallationService(); Loading @@ -63,6 +62,23 @@ public class VerificationActivity extends Activity { } } private Intent createConfirmDeviceCredentialIntent(KeyguardManager km) { final boolean useDefaultStrings = getIntent().getBooleanExtra(KEY_KEYGUARD_USE_DEFAULT_STRINGS, false); final String title; final String description; if (useDefaultStrings) { // Use default strings provided by keyguard manager title = null; description = null; } else { // Use custom strings provided by DSU title = getString(R.string.keyguard_title); description = getString(R.string.keyguard_description); } return km.createConfirmDeviceCredentialIntent(title, description); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { Loading Loading
core/java/android/os/image/DynamicSystemClient.java +9 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,15 @@ public class DynamicSystemClient { */ public static final String KEY_ONE_SHOT = "KEY_ONE_SHOT"; /** * Intent key: Whether to use default strings when showing the dialog that prompts * user for device credentials. * False indicates using the custom strings provided by {@code DynamicSystem}. * @hide */ public static final String KEY_KEYGUARD_USE_DEFAULT_STRINGS = "KEY_KEYGUARD_USE_DEFAULT_STRINGS"; private static class IncomingHandler extends Handler { private final WeakReference<DynamicSystemClient> mWeakClient; Loading
packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java +20 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.dynsystem; import static android.os.image.DynamicSystemClient.KEY_KEYGUARD_USE_DEFAULT_STRINGS; import android.app.Activity; import android.app.KeyguardManager; import android.content.Context; Loading Loading @@ -47,10 +49,7 @@ public class VerificationActivity extends Activity { KeyguardManager km = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); if (km != null) { String title = getString(R.string.keyguard_title); String description = getString(R.string.keyguard_description); Intent intent = km.createConfirmDeviceCredentialIntent(title, description); Intent intent = createConfirmDeviceCredentialIntent(km); if (intent == null) { Log.d(TAG, "This device is not protected by a password/pin"); startInstallationService(); Loading @@ -63,6 +62,23 @@ public class VerificationActivity extends Activity { } } private Intent createConfirmDeviceCredentialIntent(KeyguardManager km) { final boolean useDefaultStrings = getIntent().getBooleanExtra(KEY_KEYGUARD_USE_DEFAULT_STRINGS, false); final String title; final String description; if (useDefaultStrings) { // Use default strings provided by keyguard manager title = null; description = null; } else { // Use custom strings provided by DSU title = getString(R.string.keyguard_title); description = getString(R.string.keyguard_description); } return km.createConfirmDeviceCredentialIntent(title, description); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { Loading