Merge "Merge "Turn off quiet mode in the background, allowing the dialog to dismiss quicker." into rvc-dev am: 63458fb6e5 am: f978d16719" into rvc-d1-dev-plus-aosp

This commit is contained in:
Automerger Merge Worker
2020-06-22 17:04:00 +00:00
committed by Android (Google) Code Review

View File

@@ -26,6 +26,8 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentSender; import android.content.IntentSender;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.UserHandle; import android.os.UserHandle;
import android.os.UserManager; import android.os.UserManager;
import android.util.Log; import android.util.Log;
@@ -97,7 +99,10 @@ public class UnlaunchableAppActivity extends Activity
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
if (mReason == UNLAUNCHABLE_REASON_QUIET_MODE && which == DialogInterface.BUTTON_POSITIVE) { if (mReason == UNLAUNCHABLE_REASON_QUIET_MODE && which == DialogInterface.BUTTON_POSITIVE) {
UserManager.get(this).requestQuietModeEnabled(false, UserHandle.of(mUserId), mTarget); UserManager userManager = UserManager.get(this);
new Handler(Looper.getMainLooper()).post(
() -> userManager.requestQuietModeEnabled(
/* enableQuietMode= */ false, UserHandle.of(mUserId), mTarget));
} }
} }