Replace the current contents of this work source with the given work source. If other is null, the current work source will be made empty.
(WorkSource other)
| 177 | * will be made empty. |
| 178 | */ |
| 179 | public void set(WorkSource other) { |
| 180 | if (other == null) { |
| 181 | mNum = 0; |
| 182 | return; |
| 183 | } |
| 184 | mNum = other.mNum; |
| 185 | if (other.mUids != null) { |
| 186 | if (mUids != null && mUids.length >= mNum) { |
| 187 | System.arraycopy(other.mUids, 0, mUids, 0, mNum); |
| 188 | } else { |
| 189 | mUids = other.mUids.clone(); |
| 190 | } |
| 191 | if (other.mNames != null) { |
| 192 | if (mNames != null && mNames.length >= mNum) { |
| 193 | System.arraycopy(other.mNames, 0, mNames, 0, mNum); |
| 194 | } else { |
| 195 | mNames = other.mNames.clone(); |
| 196 | } |
| 197 | } else { |
| 198 | mNames = null; |
| 199 | } |
| 200 | } else { |
| 201 | mUids = null; |
| 202 | mNames = null; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | /** @hide */ |
| 207 | public void set(int uid) { |
no test coverage detected