Use sendBroadcastAsUser rather than sendBroadcast
According to messages in the logcat sendBroadcastAsUser is the better option. Test: Manual Bug: 31008728 Change-Id: I06bcd3c53878fc2b1b817337ea8719fcc4975501
This commit is contained in:
@@ -19,6 +19,7 @@ package android.app.timezone;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
|
import android.os.UserHandle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constants related to the contract between the Android system and the privileged time zone updater
|
* Constants related to the contract between the Android system and the privileged time zone updater
|
||||||
@@ -82,6 +83,9 @@ public final class RulesUpdaterContract {
|
|||||||
byte[] checkTokenBytes) {
|
byte[] checkTokenBytes) {
|
||||||
Intent intent = createUpdaterIntent(updaterAppPackageName);
|
Intent intent = createUpdaterIntent(updaterAppPackageName);
|
||||||
intent.putExtra(EXTRA_CHECK_TOKEN, checkTokenBytes);
|
intent.putExtra(EXTRA_CHECK_TOKEN, checkTokenBytes);
|
||||||
context.sendBroadcast(intent, RulesUpdaterContract.UPDATE_TIME_ZONE_RULES_PERMISSION);
|
context.sendBroadcastAsUser(
|
||||||
|
intent,
|
||||||
|
UserHandle.of(UserHandle.myUserId()),
|
||||||
|
RulesUpdaterContract.UPDATE_TIME_ZONE_RULES_PERMISSION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user