Merge "Moves the settings changed logging for statsd." into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
039deb4390
@@ -1151,7 +1151,7 @@ message PhoneSignalStrengthChanged {
|
||||
/**
|
||||
* Logs that a setting was updated.
|
||||
* Logged from:
|
||||
* frameworks/base/core/java/android/provider/Settings.java
|
||||
* frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
|
||||
* The tag and is_default allow resetting of settings to default values based on the specified
|
||||
* tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
|
||||
*/
|
||||
@@ -1177,8 +1177,14 @@ message SettingChanged {
|
||||
// True if this setting with tag should be resettable.
|
||||
optional bool is_default = 6;
|
||||
|
||||
// The user ID associated. Defined in android/os/UserHandle.java
|
||||
// The associated user (for multi-user feature). Defined in android/os/UserHandle.java
|
||||
optional int32 user = 7;
|
||||
|
||||
enum ChangeReason {
|
||||
UPDATED = 1; // Updated can be an insertion or an update.
|
||||
DELETED = 2;
|
||||
}
|
||||
optional ChangeReason reason = 8;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,7 +83,6 @@ import android.util.ArrayMap;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
import android.util.MemoryIntArray;
|
||||
import android.util.StatsLog;
|
||||
import android.view.textservice.TextServicesManager;
|
||||
|
||||
import com.android.internal.annotations.GuardedBy;
|
||||
@@ -1942,11 +1941,7 @@ public final class Settings {
|
||||
arg.putBoolean(CALL_METHOD_MAKE_DEFAULT_KEY, true);
|
||||
}
|
||||
IContentProvider cp = mProviderHolder.getProvider(cr);
|
||||
String prevValue = getStringForUser(cr, name, userHandle);
|
||||
cp.call(cr.getPackageName(), mCallSetCommand, name, arg);
|
||||
String newValue = getStringForUser(cr, name, userHandle);
|
||||
StatsLog.write(StatsLog.SETTING_CHANGED, name, value, newValue, prevValue, tag,
|
||||
makeDefault, userHandle);
|
||||
} catch (RemoteException e) {
|
||||
Log.w(TAG, "Can't set key " + name + " in " + mUri, e);
|
||||
return false;
|
||||
|
||||
@@ -42,6 +42,7 @@ import android.util.AtomicFile;
|
||||
import android.util.Base64;
|
||||
import android.util.Slog;
|
||||
import android.util.SparseIntArray;
|
||||
import android.util.StatsLog;
|
||||
import android.util.TimeUtils;
|
||||
import android.util.Xml;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
@@ -386,6 +387,9 @@ final class SettingsState {
|
||||
mSettings.put(name, newState);
|
||||
}
|
||||
|
||||
StatsLog.write(StatsLog.SETTING_CHANGED, name, value, newState.value, oldValue, tag,
|
||||
makeDefault, getUserIdFromKey(mKey), StatsLog.SETTING_CHANGED__REASON__UPDATED);
|
||||
|
||||
addHistoricalOperationLocked(HISTORICAL_OPERATION_UPDATE, newState);
|
||||
|
||||
updateMemoryUsagePerPackageLocked(packageName, oldValue, value,
|
||||
@@ -410,6 +414,10 @@ final class SettingsState {
|
||||
|
||||
Setting oldState = mSettings.remove(name);
|
||||
|
||||
StatsLog.write(StatsLog.SETTING_CHANGED, name, /* value= */ "", /* newValue= */ "",
|
||||
oldState.value, /* tag */ "", false, getUserIdFromKey(mKey),
|
||||
StatsLog.SETTING_CHANGED__REASON__DELETED);
|
||||
|
||||
updateMemoryUsagePerPackageLocked(oldState.packageName, oldState.value,
|
||||
null, oldState.defaultValue, null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user