Merge "Make the KEYGUARD_DELAYED broadcast priority" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
62649a71a8
@@ -1083,6 +1083,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
final IntentFilter delayedActionFilter = new IntentFilter();
|
final IntentFilter delayedActionFilter = new IntentFilter();
|
||||||
delayedActionFilter.addAction(DELAYED_KEYGUARD_ACTION);
|
delayedActionFilter.addAction(DELAYED_KEYGUARD_ACTION);
|
||||||
delayedActionFilter.addAction(DELAYED_LOCK_PROFILE_ACTION);
|
delayedActionFilter.addAction(DELAYED_LOCK_PROFILE_ACTION);
|
||||||
|
delayedActionFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||||
mContext.registerReceiver(mDelayedLockBroadcastReceiver, delayedActionFilter,
|
mContext.registerReceiver(mDelayedLockBroadcastReceiver, delayedActionFilter,
|
||||||
SYSTEMUI_PERMISSION, null /* scheduler */,
|
SYSTEMUI_PERMISSION, null /* scheduler */,
|
||||||
Context.RECEIVER_EXPORTED_UNAUDITED);
|
Context.RECEIVER_EXPORTED_UNAUDITED);
|
||||||
@@ -1392,6 +1393,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
// Lock in the future
|
// Lock in the future
|
||||||
long when = SystemClock.elapsedRealtime() + timeout;
|
long when = SystemClock.elapsedRealtime() + timeout;
|
||||||
Intent intent = new Intent(DELAYED_KEYGUARD_ACTION);
|
Intent intent = new Intent(DELAYED_KEYGUARD_ACTION);
|
||||||
|
intent.setPackage(mContext.getPackageName());
|
||||||
intent.putExtra("seq", mDelayedShowingSequence);
|
intent.putExtra("seq", mDelayedShowingSequence);
|
||||||
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
||||||
PendingIntent sender = PendingIntent.getBroadcast(mContext,
|
PendingIntent sender = PendingIntent.getBroadcast(mContext,
|
||||||
@@ -1412,11 +1414,13 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
|
|||||||
} else {
|
} else {
|
||||||
long userWhen = SystemClock.elapsedRealtime() + userTimeout;
|
long userWhen = SystemClock.elapsedRealtime() + userTimeout;
|
||||||
Intent lockIntent = new Intent(DELAYED_LOCK_PROFILE_ACTION);
|
Intent lockIntent = new Intent(DELAYED_LOCK_PROFILE_ACTION);
|
||||||
|
lockIntent.setPackage(mContext.getPackageName());
|
||||||
lockIntent.putExtra("seq", mDelayedProfileShowingSequence);
|
lockIntent.putExtra("seq", mDelayedProfileShowingSequence);
|
||||||
lockIntent.putExtra(Intent.EXTRA_USER_ID, profileId);
|
lockIntent.putExtra(Intent.EXTRA_USER_ID, profileId);
|
||||||
lockIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
lockIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
||||||
PendingIntent lockSender = PendingIntent.getBroadcast(
|
PendingIntent lockSender = PendingIntent.getBroadcast(
|
||||||
mContext, 0, lockIntent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
|
mContext, 0, lockIntent,
|
||||||
|
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
|
||||||
mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.ELAPSED_REALTIME_WAKEUP,
|
||||||
userWhen, lockSender);
|
userWhen, lockSender);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user