Merge changes from topic "tz_catchup1"
* changes: Add newly available version information to dumpsys Be more explicit about users
This commit is contained in:
@@ -83,8 +83,7 @@ public final class RulesUpdaterContract {
|
||||
Intent intent = createUpdaterIntent(updaterAppPackageName);
|
||||
intent.putExtra(EXTRA_CHECK_TOKEN, checkTokenBytes);
|
||||
context.sendBroadcastAsUser(
|
||||
intent,
|
||||
UserHandle.of(UserHandle.myUserId()),
|
||||
intent, UserHandle.SYSTEM,
|
||||
RulesUpdaterContract.UPDATE_TIME_ZONE_RULES_PERMISSION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.PatternMatcher;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Slog;
|
||||
|
||||
/**
|
||||
@@ -76,7 +77,9 @@ final class IntentHelperImpl implements IntentHelper {
|
||||
// not expected to need local data.
|
||||
|
||||
Receiver packageUpdateReceiver = new Receiver(packageTracker);
|
||||
mContext.registerReceiver(packageUpdateReceiver, packageIntentFilter);
|
||||
mContext.registerReceiverAsUser(
|
||||
packageUpdateReceiver, UserHandle.SYSTEM, packageIntentFilter,
|
||||
null /* broadcastPermission */, null /* default handler */);
|
||||
}
|
||||
|
||||
/** Sends an intent to trigger an update check. */
|
||||
|
||||
@@ -26,6 +26,7 @@ import android.content.pm.ProviderInfo;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.os.SystemClock;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Slog;
|
||||
|
||||
import java.util.List;
|
||||
@@ -114,8 +115,8 @@ final class PackageTrackerHelperImpl implements ClockHelper, ConfigHelper, Packa
|
||||
@Override
|
||||
public boolean contentProviderRegistered(String authority, String requiredPackageName) {
|
||||
int flags = PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS;
|
||||
ProviderInfo providerInfo =
|
||||
mPackageManager.resolveContentProvider(authority, flags);
|
||||
ProviderInfo providerInfo = mPackageManager.resolveContentProviderAsUser(
|
||||
authority, flags, UserHandle.SYSTEM.getIdentifier());
|
||||
if (providerInfo == null) {
|
||||
Slog.i(TAG, "contentProviderRegistered: No content provider registered with authority="
|
||||
+ authority);
|
||||
@@ -136,7 +137,8 @@ final class PackageTrackerHelperImpl implements ClockHelper, ConfigHelper, Packa
|
||||
throws PackageManager.NameNotFoundException {
|
||||
|
||||
int flags = PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS;
|
||||
List<ResolveInfo> resolveInfo = mPackageManager.queryBroadcastReceivers(intent, flags);
|
||||
List<ResolveInfo> resolveInfo = mPackageManager.queryBroadcastReceiversAsUser(
|
||||
intent, flags, UserHandle.SYSTEM);
|
||||
if (resolveInfo.size() != 1) {
|
||||
Slog.i(TAG, "receiverRegistered: Zero or multiple broadcast receiver registered for"
|
||||
+ " intent=" + intent + ", found=" + resolveInfo);
|
||||
|
||||
@@ -47,6 +47,7 @@ import java.util.Arrays;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import libcore.icu.ICU;
|
||||
import libcore.util.TimeZoneFinder;
|
||||
import libcore.util.ZoneInfoDB;
|
||||
|
||||
import static android.app.timezone.RulesState.DISTRO_STATUS_INSTALLED;
|
||||
@@ -479,9 +480,10 @@ public final class RulesManagerService extends IRulesManager.Stub {
|
||||
case 'a': {
|
||||
// Report the active rules version (i.e. the rules in use by the current
|
||||
// process).
|
||||
pw.println("Active rules version (ICU, libcore): "
|
||||
pw.println("Active rules version (ICU, ZoneInfoDB, TimeZoneFinder): "
|
||||
+ ICU.getTZDataVersion() + ","
|
||||
+ ZoneInfoDB.getInstance().getVersion());
|
||||
+ ZoneInfoDB.getInstance().getVersion() + ","
|
||||
+ TimeZoneFinder.getInstance().getIanaVersion());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -494,8 +496,10 @@ public final class RulesManagerService extends IRulesManager.Stub {
|
||||
}
|
||||
|
||||
pw.println("RulesManagerService state: " + toString());
|
||||
pw.println("Active rules version (ICU, libcore): " + ICU.getTZDataVersion() + ","
|
||||
+ ZoneInfoDB.getInstance().getVersion());
|
||||
pw.println("Active rules version (ICU, ZoneInfoDB, TimeZoneFinder): "
|
||||
+ ICU.getTZDataVersion() + ","
|
||||
+ ZoneInfoDB.getInstance().getVersion() + ","
|
||||
+ TimeZoneFinder.getInstance().getIanaVersion());
|
||||
pw.println("Distro state: " + rulesState.toString());
|
||||
mPackageTracker.dump(pw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user