Merge "Prevent race condition by foregroundAppPackageName" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4a20c7361a
@@ -993,8 +993,9 @@ class AutomaticBrightnessController {
|
|||||||
final String packageName = info.topActivity.getPackageName();
|
final String packageName = info.topActivity.getPackageName();
|
||||||
// If the app didn't change, there's nothing to do. Otherwise, we have to
|
// If the app didn't change, there's nothing to do. Otherwise, we have to
|
||||||
// update the category and re-apply the brightness correction.
|
// update the category and re-apply the brightness correction.
|
||||||
if (mForegroundAppPackageName != null
|
String currentForegroundAppPackageName = mForegroundAppPackageName;
|
||||||
&& mForegroundAppPackageName.equals(packageName)) {
|
if (currentForegroundAppPackageName != null
|
||||||
|
&& currentForegroundAppPackageName.equals(packageName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mPendingForegroundAppPackageName = packageName;
|
mPendingForegroundAppPackageName = packageName;
|
||||||
|
|||||||
Reference in New Issue
Block a user