|
26 | 26 | import android.accounts.AuthenticatorDescription;
|
27 | 27 | import android.app.ActionBar;
|
28 | 28 | import android.app.Activity;
|
| 29 | +import android.app.AlertDialog; |
29 | 30 | import android.app.admin.DevicePolicyManager;
|
30 | 31 | import android.app.settings.SettingsEnums;
|
31 | 32 | import android.content.ComponentName;
|
32 | 33 | import android.content.ContentResolver;
|
33 | 34 | import android.content.Context;
|
| 35 | +import android.content.DialogInterface; |
34 | 36 | import android.content.Intent;
|
35 | 37 | import android.content.pm.PackageManager;
|
36 | 38 | import android.content.pm.ResolveInfo;
|
|
43 | 45 | import android.os.SystemProperties;
|
44 | 46 | import android.os.UserHandle;
|
45 | 47 | import android.os.UserManager;
|
| 48 | +import android.os.image.DynamicSystemManager; |
46 | 49 | import android.provider.Settings;
|
47 | 50 | import android.sysprop.VoldProperties;
|
48 | 51 | import android.telephony.euicc.EuiccManager;
|
@@ -267,6 +270,19 @@ public void onClick(View view) {
|
267 | 270 | return;
|
268 | 271 | }
|
269 | 272 |
|
| 273 | + final DynamicSystemManager dsuManager = (DynamicSystemManager) |
| 274 | + getActivity().getSystemService(Context.DYNAMIC_SYSTEM_SERVICE); |
| 275 | + if (dsuManager.isInUse()) { |
| 276 | + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |
| 277 | + builder.setTitle(R.string.dsu_is_running); |
| 278 | + builder.setPositiveButton(R.string.okay, new DialogInterface.OnClickListener() { |
| 279 | + public void onClick(DialogInterface dialog, int id) {} |
| 280 | + }); |
| 281 | + AlertDialog dsuAlertdialog = builder.create(); |
| 282 | + dsuAlertdialog.show(); |
| 283 | + return; |
| 284 | + } |
| 285 | + |
270 | 286 | if (runKeyguardConfirmation(KEYGUARD_REQUEST)) {
|
271 | 287 | return;
|
272 | 288 | }
|
|
0 commit comments