| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
package android.app.usage; |
| 17 |
|
| 18 |
import android.compat.annotation.UnsupportedAppUsage; |
| 19 |
import android.content.res.Configuration; |
| 20 |
import android.os.Build; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public final class ConfigurationStats implements Parcelable { |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 34 |
public Configuration mConfiguration; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 40 |
public long mBeginTimeStamp; |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 46 |
public long mEndTimeStamp; |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 52 |
public long mLastTimeActive; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 58 |
public long mTotalTimeActive; |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) |
| 64 |
public int mActivationCount; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
public ConfigurationStats() { |
| 70 |
} |
| 71 |
|
| 72 |
public ConfigurationStats(ConfigurationStats stats) { |
| 73 |
mConfiguration = stats.mConfiguration; |
| 74 |
mBeginTimeStamp = stats.mBeginTimeStamp; |
| 75 |
mEndTimeStamp = stats.mEndTimeStamp; |
| 76 |
mLastTimeActive = stats.mLastTimeActive; |
| 77 |
mTotalTimeActive = stats.mTotalTimeActive; |
| 78 |
mActivationCount = stats.mActivationCount; |
| 79 |
} |
| 80 |
|
| 81 |
public Configuration getConfiguration() { |
| 82 |
return mConfiguration; |
| 83 |
} |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
public long getFirstTimeStamp() { |
| 92 |
return mBeginTimeStamp; |
| 93 |
} |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
public long getLastTimeStamp() { |
| 102 |
return mEndTimeStamp; |
| 103 |
} |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
public long getLastTimeActive() { |
| 111 |
return mLastTimeActive; |
| 112 |
} |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
public long getTotalTimeActive() { |
| 118 |
return mTotalTimeActive; |
| 119 |
} |
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
public int getActivationCount() { |
| 125 |
return mActivationCount; |
| 126 |
} |
| 127 |
|
| 128 |
@Override |
| 129 |
public int describeContents() { |
| 130 |
return 0; |
| 131 |
} |
| 132 |
|
| 133 |
@Override |
| 134 |
public void writeToParcel(Parcel dest, int flags) { |
| 135 |
if (mConfiguration != null) { |
| 136 |
dest.writeInt(1); |
| 137 |
mConfiguration.writeToParcel(dest, flags); |
| 138 |
} else { |
| 139 |
dest.writeInt(0); |
| 140 |
} |
| 141 |
|
| 142 |
dest.writeLong(mBeginTimeStamp); |
| 143 |
dest.writeLong(mEndTimeStamp); |
| 144 |
dest.writeLong(mLastTimeActive); |
| 145 |
dest.writeLong(mTotalTimeActive); |
| 146 |
dest.writeInt(mActivationCount); |
| 147 |
} |
| 148 |
|
| 149 |
public static final @android.annotation.NonNull Creator<ConfigurationStats> CREATOR = new Creator<ConfigurationStats>() { |
| 150 |
@Override |
| 151 |
public ConfigurationStats createFromParcel(Parcel source) { |
| 152 |
ConfigurationStats stats = new ConfigurationStats(); |
| 153 |
if (source.readInt() != 0) { |
| 154 |
stats.mConfiguration = Configuration.CREATOR.createFromParcel(source); |
| 155 |
} |
| 156 |
stats.mBeginTimeStamp = source.readLong(); |
| 157 |
stats.mEndTimeStamp = source.readLong(); |
| 158 |
stats.mLastTimeActive = source.readLong(); |
| 159 |
stats.mTotalTimeActive = source.readLong(); |
| 160 |
stats.mActivationCount = source.readInt(); |
| 161 |
return stats; |
| 162 |
} |
| 163 |
|
| 164 |
@Override |
| 165 |
public ConfigurationStats[] newArray(int size) { |
| 166 |
return new ConfigurationStats[size]; |
| 167 |
} |
| 168 |
}; |
| 169 |
} |