Loading cmds/statsd/src/stats_events.proto +45 −12 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ message StatsEvent { WifiSignalStrengthChanged wifi_signal_strength_changed = 38; WifiScanStateChanged wifi_scan_state_changed = 39; PhoneSignalStrengthChanged phone_signal_strength_changed = 40; SettingChanged setting_changed = 41; // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15. } } Loading Loading @@ -646,3 +646,36 @@ message PhoneSignalStrengthChanged { } optional SignalStrength signal_strength = 1; } /** * Logs that a setting was updated. * Logged from: * frameworks/base/core/java/android/provider/Settings.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. */ message SettingChanged { // The name of the setting. optional string setting = 1; // The change being imposed on this setting. May represent a number, eg "3". optional string value = 2; // The new value of this setting. For most settings, this is same as value. For some settings, // value is +X or -X where X represents an element in a set. For example, if the previous value // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. // The +/- feature is currently only used for location_providers_allowed. optional string new_value = 3; // The previous value of this setting. optional string prev_value = 4; // The tag used with the is_default for resetting sets of settings. This is generally null. optional string tag = 5; // 1 indicates that this setting with tag should be resettable. optional int32 is_default = 6; // The user ID associated. Defined in android/os/UserHandle.java optional int32 user = 7; } core/java/android/provider/Settings.java +5 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import android.util.MemoryIntArray; import android.util.StatsLog; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.ArrayUtils; Loading Loading @@ -1886,7 +1887,11 @@ 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 ? 1 : 0, userHandle); } catch (RemoteException e) { Log.w(TAG, "Can't set key " + name + " in " + mUri, e); return false; Loading tests/testables/tests/AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -15,9 +15,11 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.testables"> package="com.android.testables" android:sharedUserId="android.uid.system"> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.MANAGE_USERS" /> <application> <uses-library android:name="android.test.runner" /> Loading Loading
cmds/statsd/src/stats_events.proto +45 −12 Original line number Diff line number Diff line Loading @@ -69,7 +69,7 @@ message StatsEvent { WifiSignalStrengthChanged wifi_signal_strength_changed = 38; WifiScanStateChanged wifi_scan_state_changed = 39; PhoneSignalStrengthChanged phone_signal_strength_changed = 40; SettingChanged setting_changed = 41; // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15. } } Loading Loading @@ -646,3 +646,36 @@ message PhoneSignalStrengthChanged { } optional SignalStrength signal_strength = 1; } /** * Logs that a setting was updated. * Logged from: * frameworks/base/core/java/android/provider/Settings.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. */ message SettingChanged { // The name of the setting. optional string setting = 1; // The change being imposed on this setting. May represent a number, eg "3". optional string value = 2; // The new value of this setting. For most settings, this is same as value. For some settings, // value is +X or -X where X represents an element in a set. For example, if the previous value // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. // The +/- feature is currently only used for location_providers_allowed. optional string new_value = 3; // The previous value of this setting. optional string prev_value = 4; // The tag used with the is_default for resetting sets of settings. This is generally null. optional string tag = 5; // 1 indicates that this setting with tag should be resettable. optional int32 is_default = 6; // The user ID associated. Defined in android/os/UserHandle.java optional int32 user = 7; }
core/java/android/provider/Settings.java +5 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import android.util.MemoryIntArray; import android.util.StatsLog; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.ArrayUtils; Loading Loading @@ -1886,7 +1887,11 @@ 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 ? 1 : 0, userHandle); } catch (RemoteException e) { Log.w(TAG, "Can't set key " + name + " in " + mUri, e); return false; Loading
tests/testables/tests/AndroidManifest.xml +3 −1 Original line number Diff line number Diff line Loading @@ -15,9 +15,11 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.testables"> package="com.android.testables" android:sharedUserId="android.uid.system"> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /> <uses-permission android:name="android.permission.MANAGE_USERS" /> <application> <uses-library android:name="android.test.runner" /> Loading