1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
|
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.ide.common.xml;
import com.android.resources.Keyboard;
import com.android.resources.Navigation;
import com.android.resources.TouchScreen;
import java.util.ArrayList;
import java.util.Set;
import java.util.TreeSet;
/**
* Class containing the manifest info obtained during the parsing.
*/
public final class ManifestData {
/**
* Value returned by {@link #getMinSdkVersion()} when the value of the minSdkVersion attribute
* in the manifest is a codename and not an integer value.
*/
public final static int MIN_SDK_CODENAME = 0;
/**
* Value returned by {@link #getGlEsVersion()} when there are no <uses-feature> node with the
* attribute glEsVersion set.
*/
public final static int GL_ES_VERSION_NOT_SET = -1;
/** Application package */
String mPackage;
/** Application version Code, null if the attribute is not present. */
Integer mVersionCode = null;
/** List of all activities */
final ArrayList<Activity> mActivities = new ArrayList<Activity>();
/** Launcher activity */
Activity mLauncherActivity = null;
/** list of process names declared by the manifest */
Set<String> mProcesses = null;
/** debuggable attribute value. If null, the attribute is not present. */
Boolean mDebuggable = null;
/** API level requirement. if null the attribute was not present. */
private String mMinSdkVersionString = null;
/** API level requirement. Default is 1 even if missing. If value is a codename, then it'll be
* 0 instead. */
private int mMinSdkVersion = 1;
private int mTargetSdkVersion = 0;
/** List of all instrumentations declared by the manifest */
final ArrayList<Instrumentation> mInstrumentations =
new ArrayList<Instrumentation>();
/** List of all libraries in use declared by the manifest */
final ArrayList<UsesLibrary> mLibraries = new ArrayList<UsesLibrary>();
/** List of all feature in use declared by the manifest */
final ArrayList<UsesFeature> mFeatures = new ArrayList<UsesFeature>();
SupportsScreens mSupportsScreensFromManifest;
SupportsScreens mSupportsScreensValues;
UsesConfiguration mUsesConfiguration;
/**
* Instrumentation info obtained from manifest
*/
public final static class Instrumentation {
private final String mName;
private final String mTargetPackage;
Instrumentation(String name, String targetPackage) {
mName = name;
mTargetPackage = targetPackage;
}
/**
* Returns the fully qualified instrumentation class name
*/
public String getName() {
return mName;
}
/**
* Returns the Android app package that is the target of this instrumentation
*/
public String getTargetPackage() {
return mTargetPackage;
}
}
/**
* Activity info obtained from the manifest.
*/
public final static class Activity {
private final String mName;
private final boolean mIsExported;
private boolean mHasAction = false;
private boolean mHasMainAction = false;
private boolean mHasLauncherCategory = false;
public Activity(String name, boolean exported) {
mName = name;
mIsExported = exported;
}
public String getName() {
return mName;
}
public boolean isExported() {
return mIsExported;
}
public boolean hasAction() {
return mHasAction;
}
public boolean isHomeActivity() {
return mHasMainAction && mHasLauncherCategory;
}
void setHasAction(boolean hasAction) {
mHasAction = hasAction;
}
/** If the activity doesn't yet have a filter set for the launcher, this resets both
* flags. This is to handle multiple intent-filters where one could have the valid
* action, and another one of the valid category.
*/
void resetIntentFilter() {
if (isHomeActivity() == false) {
mHasMainAction = mHasLauncherCategory = false;
}
}
void setHasMainAction(boolean hasMainAction) {
mHasMainAction = hasMainAction;
}
void setHasLauncherCategory(boolean hasLauncherCategory) {
mHasLauncherCategory = hasLauncherCategory;
}
}
/**
* Class representing the <code>supports-screens</code> node in the manifest.
* By default, all the getters will return null if there was no value defined in the manifest.
*
* To get an instance with all the actual values, use {@link #resolveSupportsScreensValues(int)}
*/
public final static class SupportsScreens {
private Boolean mResizeable;
private Boolean mAnyDensity;
private Boolean mSmallScreens;
private Boolean mNormalScreens;
private Boolean mLargeScreens;
public SupportsScreens() {
}
/**
* Instantiate an instance from a string. The string must have been created with
* {@link #getEncodedValues()}.
* @param value the string.
*/
public SupportsScreens(String value) {
String[] values = value.split("\\|");
mAnyDensity = Boolean.valueOf(values[0]);
mResizeable = Boolean.valueOf(values[1]);
mSmallScreens = Boolean.valueOf(values[2]);
mNormalScreens = Boolean.valueOf(values[3]);
mLargeScreens = Boolean.valueOf(values[4]);
}
/**
* Returns an instance of {@link SupportsScreens} initialized with the default values
* based on the given targetSdkVersion.
* @param targetSdkVersion
*/
public static SupportsScreens getDefaultValues(int targetSdkVersion) {
SupportsScreens result = new SupportsScreens();
result.mNormalScreens = Boolean.TRUE;
// Screen size and density became available in Android 1.5/API3, so before that
// non normal screens were not supported by default. After they are considered
// supported.
result.mResizeable = result.mAnyDensity = result.mSmallScreens = result.mLargeScreens =
targetSdkVersion <= 3 ? Boolean.FALSE : Boolean.TRUE;
return result;
}
/**
* Returns a version of the receiver for which all values have been set, even if they
* were not present in the manifest.
* @param targetSdkVersion the target api level of the app, since this has an effect
* on default values.
*/
public SupportsScreens resolveSupportsScreensValues(int targetSdkVersion) {
SupportsScreens result = getDefaultValues(targetSdkVersion);
// Override the default with the existing values:
if (mResizeable != null) result.mResizeable = mResizeable;
if (mAnyDensity != null) result.mAnyDensity = mAnyDensity;
if (mSmallScreens != null) result.mSmallScreens = mSmallScreens;
if (mNormalScreens != null) result.mNormalScreens = mNormalScreens;
if (mLargeScreens != null) result.mLargeScreens = mLargeScreens;
return result;
}
/**
* returns the value of the <code>resizeable</code> attribute or null if not present.
*/
public Boolean getResizeable() {
return mResizeable;
}
void setResizeable(Boolean resizeable) {
mResizeable = getConstantBoolean(resizeable);
}
/**
* returns the value of the <code>anyDensity</code> attribute or null if not present.
*/
public Boolean getAnyDensity() {
return mAnyDensity;
}
void setAnyDensity(Boolean anyDensity) {
mAnyDensity = getConstantBoolean(anyDensity);
}
/**
* returns the value of the <code>smallScreens</code> attribute or null if not present.
*/
public Boolean getSmallScreens() {
return mSmallScreens;
}
void setSmallScreens(Boolean smallScreens) {
mSmallScreens = getConstantBoolean(smallScreens);
}
/**
* returns the value of the <code>normalScreens</code> attribute or null if not present.
*/
public Boolean getNormalScreens() {
return mNormalScreens;
}
void setNormalScreens(Boolean normalScreens) {
mNormalScreens = getConstantBoolean(normalScreens);
}
/**
* returns the value of the <code>largeScreens</code> attribute or null if not present.
*/
public Boolean getLargeScreens() {
return mLargeScreens;
}
void setLargeScreens(Boolean largeScreens) {
mLargeScreens = getConstantBoolean(largeScreens);
}
/**
* Returns either {@link Boolean#TRUE} or {@link Boolean#FALSE} based on the value of
* the given Boolean object.
*/
private Boolean getConstantBoolean(Boolean v) {
if (v != null) {
if (v.equals(Boolean.TRUE)) {
return Boolean.TRUE;
} else {
return Boolean.FALSE;
}
}
return null;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof SupportsScreens) {
SupportsScreens support = (SupportsScreens) obj;
// since all the fields are guaranteed to be either Boolean.TRUE or Boolean.FALSE
// (or null), we can simply check they are identical and not bother with
// calling equals (which would require to check != null.
// see #getConstanntBoolean(Boolean)
return mResizeable == support.mResizeable &&
mAnyDensity == support.mAnyDensity &&
mSmallScreens == support.mSmallScreens &&
mNormalScreens == support.mNormalScreens &&
mLargeScreens == support.mLargeScreens;
}
return false;
}
/* Override hashCode, mostly to make Eclipse happy and not warn about it.
* And if you ever put this in a Map or Set, it will avoid surprises. */
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((mAnyDensity == null) ? 0 : mAnyDensity.hashCode());
result = prime * result + ((mLargeScreens == null) ? 0 : mLargeScreens.hashCode());
result = prime * result + ((mNormalScreens == null) ? 0 : mNormalScreens.hashCode());
result = prime * result + ((mResizeable == null) ? 0 : mResizeable.hashCode());
result = prime * result + ((mSmallScreens == null) ? 0 : mSmallScreens.hashCode());
return result;
}
/**
* Returns true if the two instances support the same screen sizes.
* This is similar to {@link #equals(Object)} except that it ignores the values of
* {@link #getAnyDensity()} and {@link #getResizeable()}.
* @param support the other instance to compare to.
* @return true if the two instances support the same screen sizes.
*/
public boolean hasSameScreenSupportAs(SupportsScreens support) {
// since all the fields are guaranteed to be either Boolean.TRUE or Boolean.FALSE
// (or null), we can simply check they are identical and not bother with
// calling equals (which would require to check != null.
// see #getConstanntBoolean(Boolean)
// This only checks that matter here are the screen sizes. resizeable and anyDensity
// are not checked.
return mSmallScreens == support.mSmallScreens &&
mNormalScreens == support.mNormalScreens &&
mLargeScreens == support.mLargeScreens;
}
/**
* Returns true if the two instances have strictly different screen size support.
* This means that there is no screen size that they both support.
* @param support the other instance to compare to.
* @return true if they are stricly different.
*/
public boolean hasStrictlyDifferentScreenSupportAs(SupportsScreens support) {
// since all the fields are guaranteed to be either Boolean.TRUE or Boolean.FALSE
// (or null), we can simply check they are identical and not bother with
// calling equals (which would require to check != null.
// see #getConstanntBoolean(Boolean)
// This only checks that matter here are the screen sizes. resizeable and anyDensity
// are not checked.
return (mSmallScreens != Boolean.TRUE || support.mSmallScreens != Boolean.TRUE) &&
(mNormalScreens != Boolean.TRUE || support.mNormalScreens != Boolean.TRUE) &&
(mLargeScreens != Boolean.TRUE || support.mLargeScreens != Boolean.TRUE);
}
/**
* Comparison of 2 Supports-screens. This only uses screen sizes (ignores resizeable and
* anyDensity), and considers that
* {@link #hasStrictlyDifferentScreenSupportAs(SupportsScreens)} returns true and
* {@link #overlapWith(SupportsScreens)} returns false.
* @throws IllegalArgumentException if the two instanced are not strictly different or
* overlap each other
* @see #hasStrictlyDifferentScreenSupportAs(SupportsScreens)
* @see #overlapWith(SupportsScreens)
*/
public int compareScreenSizesWith(SupportsScreens o) {
if (hasStrictlyDifferentScreenSupportAs(o) == false) {
throw new IllegalArgumentException("The two instances are not strictly different.");
}
if (overlapWith(o)) {
throw new IllegalArgumentException("The two instances overlap each other.");
}
int comp = mLargeScreens.compareTo(o.mLargeScreens);
if (comp != 0) return comp;
comp = mNormalScreens.compareTo(o.mNormalScreens);
if (comp != 0) return comp;
comp = mSmallScreens.compareTo(o.mSmallScreens);
if (comp != 0) return comp;
return 0;
}
/**
* Returns a string encoding of the content of the instance. This string can be used to
* instantiate a {@link SupportsScreens} object through
* {@link #SupportsScreens(String)}.
*/
public String getEncodedValues() {
return String.format("%1$s|%2$s|%3$s|%4$s|%5$s",
mAnyDensity, mResizeable, mSmallScreens, mNormalScreens, mLargeScreens);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
boolean alreadyOutputSomething = false;
if (Boolean.TRUE.equals(mSmallScreens)) {
alreadyOutputSomething = true;
sb.append("small");
}
if (Boolean.TRUE.equals(mNormalScreens)) {
if (alreadyOutputSomething) {
sb.append(", ");
}
alreadyOutputSomething = true;
sb.append("normal");
}
if (Boolean.TRUE.equals(mLargeScreens)) {
if (alreadyOutputSomething) {
sb.append(", ");
}
alreadyOutputSomething = true;
sb.append("large");
}
if (alreadyOutputSomething == false) {
sb.append("<none>");
}
return sb.toString();
}
/**
* Returns true if the two instance overlap with each other.
* This can happen if one instances supports a size, when the other instance doesn't while
* supporting a size above and a size below.
* @param otherSS the other supports-screens to compare to.
*/
public boolean overlapWith(SupportsScreens otherSS) {
if (mSmallScreens == null || mNormalScreens == null || mLargeScreens == null ||
otherSS.mSmallScreens == null || otherSS.mNormalScreens == null ||
otherSS.mLargeScreens == null) {
throw new IllegalArgumentException("Some screen sizes Boolean are not initialized");
}
if (mSmallScreens == Boolean.TRUE && mNormalScreens == Boolean.FALSE &&
mLargeScreens == Boolean.TRUE) {
return otherSS.mNormalScreens == Boolean.TRUE;
}
if (otherSS.mSmallScreens == Boolean.TRUE && otherSS.mNormalScreens == Boolean.FALSE &&
otherSS.mLargeScreens == Boolean.TRUE) {
return mNormalScreens == Boolean.TRUE;
}
return false;
}
}
/**
* Class representing a <code>uses-library</code> node in the manifest.
*/
public final static class UsesLibrary {
String mName;
Boolean mRequired = Boolean.TRUE; // default is true even if missing
public String getName() {
return mName;
}
public Boolean getRequired() {
return mRequired;
}
}
/**
* Class representing a <code>uses-feature</code> node in the manifest.
*/
public final static class UsesFeature {
String mName;
int mGlEsVersion = 0;
Boolean mRequired = Boolean.TRUE; // default is true even if missing
public String getName() {
return mName;
}
/**
* Returns the value of the glEsVersion attribute, or 0 if the attribute was not present.
*/
public int getGlEsVersion() {
return mGlEsVersion;
}
public Boolean getRequired() {
return mRequired;
}
}
/**
* Class representing the <code>uses-configuration</code> node in the manifest.
*/
public final static class UsesConfiguration {
Boolean mReqFiveWayNav;
Boolean mReqHardKeyboard;
Keyboard mReqKeyboardType;
TouchScreen mReqTouchScreen;
Navigation mReqNavigation;
/**
* returns the value of the <code>reqFiveWayNav</code> attribute or null if not present.
*/
public Boolean getReqFiveWayNav() {
return mReqFiveWayNav;
}
/**
* returns the value of the <code>reqNavigation</code> attribute or null if not present.
*/
public Navigation getReqNavigation() {
return mReqNavigation;
}
/**
* returns the value of the <code>reqHardKeyboard</code> attribute or null if not present.
*/
public Boolean getReqHardKeyboard() {
return mReqHardKeyboard;
}
/**
* returns the value of the <code>reqKeyboardType</code> attribute or null if not present.
*/
public Keyboard getReqKeyboardType() {
return mReqKeyboardType;
}
/**
* returns the value of the <code>reqTouchScreen</code> attribute or null if not present.
*/
public TouchScreen getReqTouchScreen() {
return mReqTouchScreen;
}
}
/**
* Returns the package defined in the manifest, if found.
* @return The package name or null if not found.
*/
public String getPackage() {
return mPackage;
}
/**
* Returns the versionCode value defined in the manifest, if found, null otherwise.
* @return the versionCode or null if not found.
*/
public Integer getVersionCode() {
return mVersionCode;
}
/**
* Returns the list of activities found in the manifest.
* @return An array of fully qualified class names, or empty if no activity were found.
*/
public Activity[] getActivities() {
return mActivities.toArray(new Activity[mActivities.size()]);
}
/**
* Returns the name of one activity found in the manifest, that is configured to show
* up in the HOME screen.
* @return the fully qualified name of a HOME activity or null if none were found.
*/
public Activity getLauncherActivity() {
return mLauncherActivity;
}
/**
* Returns the list of process names declared by the manifest.
*/
public String[] getProcesses() {
if (mProcesses != null) {
return mProcesses.toArray(new String[mProcesses.size()]);
}
return new String[0];
}
/**
* Returns the <code>debuggable</code> attribute value or null if it is not set.
*/
public Boolean getDebuggable() {
return mDebuggable;
}
/**
* Returns the <code>minSdkVersion</code> attribute, or null if it's not set.
*/
public String getMinSdkVersionString() {
return mMinSdkVersionString;
}
/**
* Sets the value of the <code>minSdkVersion</code> attribute.
* @param minSdkVersion the string value of the attribute in the manifest.
*/
public void setMinSdkVersionString(String minSdkVersion) {
mMinSdkVersionString = minSdkVersion;
if (mMinSdkVersionString != null) {
try {
mMinSdkVersion = Integer.parseInt(mMinSdkVersionString);
} catch (NumberFormatException e) {
mMinSdkVersion = MIN_SDK_CODENAME;
}
}
}
/**
* Returns the <code>minSdkVersion</code> attribute, or 0 if it's not set or is a codename.
* @see #getMinSdkVersionString()
*/
public int getMinSdkVersion() {
return mMinSdkVersion;
}
/**
* Sets the value of the <code>minSdkVersion</code> attribute.
* @param targetSdkVersion the string value of the attribute in the manifest.
*/
public void setTargetSdkVersionString(String targetSdkVersion) {
if (targetSdkVersion != null) {
try {
mTargetSdkVersion = Integer.parseInt(targetSdkVersion);
} catch (NumberFormatException e) {
// keep the value at 0.
}
}
}
/**
* Returns the <code>targetSdkVersion</code> attribute, or the same value as
* {@link #getMinSdkVersion()} if it was not set in the manifest.
*/
public int getTargetSdkVersion() {
if (mTargetSdkVersion == 0) {
return getMinSdkVersion();
}
return mTargetSdkVersion;
}
/**
* Returns the list of instrumentations found in the manifest.
* @return An array of {@link Instrumentation}, or empty if no instrumentations were
* found.
*/
public Instrumentation[] getInstrumentations() {
return mInstrumentations.toArray(new Instrumentation[mInstrumentations.size()]);
}
/**
* Returns the list of libraries in use found in the manifest.
* @return An array of {@link UsesLibrary} objects, or empty if no libraries were found.
*/
public UsesLibrary[] getUsesLibraries() {
return mLibraries.toArray(new UsesLibrary[mLibraries.size()]);
}
/**
* Returns the list of features in use found in the manifest.
* @return An array of {@link UsesFeature} objects, or empty if no libraries were found.
*/
public UsesFeature[] getUsesFeatures() {
return mFeatures.toArray(new UsesFeature[mFeatures.size()]);
}
/**
* Returns the glEsVersion from a <uses-feature> or {@link #GL_ES_VERSION_NOT_SET} if not set.
*/
public int getGlEsVersion() {
for (UsesFeature feature : mFeatures) {
if (feature.mGlEsVersion > 0) {
return feature.mGlEsVersion;
}
}
return GL_ES_VERSION_NOT_SET;
}
/**
* Returns the {@link SupportsScreens} object representing the <code>supports-screens</code>
* node, or null if the node doesn't exist at all.
* Some values in the {@link SupportsScreens} instance maybe null, indicating that they
* were not present in the manifest. To get an instance that contains the values, as seen
* by the Android platform when the app is running, use {@link #getSupportsScreensValues()}.
*/
public SupportsScreens getSupportsScreensFromManifest() {
return mSupportsScreensFromManifest;
}
/**
* Returns an always non-null instance of {@link SupportsScreens} that's been initialized with
* the default values, and the values from the manifest.
* The default values depends on the manifest values for minSdkVersion and targetSdkVersion.
*/
public synchronized SupportsScreens getSupportsScreensValues() {
if (mSupportsScreensValues == null) {
if (mSupportsScreensFromManifest == null) {
mSupportsScreensValues = SupportsScreens.getDefaultValues(getTargetSdkVersion());
} else {
// get a SupportsScreen that replace the missing values with default values.
mSupportsScreensValues = mSupportsScreensFromManifest.resolveSupportsScreensValues(
getTargetSdkVersion());
}
}
return mSupportsScreensValues;
}
/**
* Returns the {@link UsesConfiguration} object representing the <code>uses-configuration</code>
* node, or null if the node doesn't exist at all.
*/
public UsesConfiguration getUsesConfiguration() {
return mUsesConfiguration;
}
void addProcessName(String processName) {
if (mProcesses == null) {
mProcesses = new TreeSet<String>();
}
if (processName.startsWith(":")) {
mProcesses.add(mPackage + processName);
} else {
mProcesses.add(processName);
}
}
}
|