Commit | Line | Data |
---|---|---|
5db0f233 | 1 | From ad530e4d84bd08402c41c1c31e90c560fc7def17 Mon Sep 17 00:00:00 2001 |
6bcbafcd L |
2 | From: Jacob McSwain <jacob.a.mcswain@gmail.com> |
3 | Date: Sun, 26 Jun 2016 15:21:52 -0500 | |
5db0f233 | 4 | Subject: [PATCH 11/52] OMS7-N: Implement multi-target enable/disable and |
6bcbafcd L |
5 | disable-all [11/11] |
6 | ||
7 | Just use the enable option like normal, but you can add more arguments | |
8 | for more packages. Also add a feature that allows the client to disable | |
9 | all of the current user's overlays. | |
10 | ||
11 | Multiple targets example: | |
12 | om enable android.AkZent com.android.systemui.AkZent | |
13 | ||
14 | Works the same as: | |
15 | om enable android.AkZent && om enable com.android.systemui.AkZent | |
16 | ||
17 | Original implementation for M by @USA-RedDragon | |
18 | Current and further development by @nicholaschum | |
19 | ||
20 | Change-Id: I04a595084a87b8260b5c534c4f5f111adbe154d7 | |
21 | --- | |
22 | core/java/android/content/om/IOverlayManager.aidl | 10 +- | |
23 | .../android/server/om/OverlayManagerService.java | 48 ++++++---- | |
24 | .../server/om/OverlayManagerServiceImpl.java | 12 ++- | |
25 | .../android/server/om/OverlayManagerSettings.java | 31 +++--- | |
26 | .../server/om/OverlayManagerShellCommand.java | 104 +++++++++++++++++++-- | |
27 | 5 files changed, 161 insertions(+), 44 deletions(-) | |
28 | ||
29 | diff --git a/core/java/android/content/om/IOverlayManager.aidl b/core/java/android/content/om/IOverlayManager.aidl | |
d1b877b3 | 30 | index 4f5d96038d1..8e349dcf6ca 100644 |
6bcbafcd L |
31 | --- a/core/java/android/content/om/IOverlayManager.aidl |
32 | +++ b/core/java/android/content/om/IOverlayManager.aidl | |
33 | @@ -83,10 +83,12 @@ interface IOverlayManager { | |
34 | * @param packageName The name of the overlay package. | |
35 | * @param enable true to enable the overlay, false to disable it. | |
36 | * @param userId The user for which to change the overlay. | |
37 | + * @param shouldWait true to wait to reload resources until refresh is called | |
38 | * @return true if the system successfully registered the request, false | |
39 | * otherwise. | |
40 | */ | |
41 | - boolean setEnabled(in String packageName, in boolean enable, in int userId); | |
42 | + boolean setEnabled(in String packageName, in boolean enable, in int userId, | |
43 | + in boolean shouldWait); | |
44 | ||
45 | /** | |
46 | * Change the priority of the given overlay to be just higher than the | |
47 | @@ -126,4 +128,10 @@ interface IOverlayManager { | |
48 | * @param userId The user for which to change the overlay. | |
49 | */ | |
50 | boolean setLowestPriority(in String packageName, in int userId); | |
51 | + | |
52 | + /** | |
53 | + * Refresh assets | |
54 | + * @param uid the user to refresh assets for | |
55 | + */ | |
56 | + void refresh(in int uid); | |
57 | } | |
58 | diff --git a/services/core/java/com/android/server/om/OverlayManagerService.java b/services/core/java/com/android/server/om/OverlayManagerService.java | |
d1b877b3 | 59 | index 761ef5240ec..deb9046a2d4 100644 |
6bcbafcd L |
60 | --- a/services/core/java/com/android/server/om/OverlayManagerService.java |
61 | +++ b/services/core/java/com/android/server/om/OverlayManagerService.java | |
62 | @@ -255,7 +255,7 @@ public final class OverlayManagerService extends SystemService { | |
63 | synchronized (mLock) { | |
64 | targets = mImpl.onSwitchUser(newUserId); | |
65 | } | |
66 | - updateAssets(newUserId, targets); | |
67 | + updateSelectedAssets(newUserId, targets); | |
68 | } | |
69 | ||
70 | public List<String> getEnabledOverlayPaths(@NonNull final String packageName, | |
71 | @@ -451,7 +451,7 @@ public final class OverlayManagerService extends SystemService { | |
72 | ||
73 | @Override | |
74 | public boolean setEnabled(@Nullable final String packageName, final boolean enable, | |
75 | - int userId) throws RemoteException { | |
76 | + int userId, final boolean shouldWait) throws RemoteException { | |
77 | enforceChangeConfigurationPermission("setEnabled"); | |
78 | userId = handleIncomingUser(userId, "setEnabled"); | |
79 | if (packageName == null) { | |
80 | @@ -461,7 +461,7 @@ public final class OverlayManagerService extends SystemService { | |
81 | final long ident = Binder.clearCallingIdentity(); | |
82 | try { | |
83 | synchronized (mLock) { | |
84 | - return mImpl.onSetEnabled(packageName, enable, userId); | |
85 | + return mImpl.onSetEnabled(packageName, enable, userId, shouldWait); | |
86 | } | |
87 | } finally { | |
88 | Binder.restoreCallingIdentity(ident); | |
89 | @@ -590,6 +590,15 @@ public final class OverlayManagerService extends SystemService { | |
90 | message); | |
91 | } | |
92 | } | |
93 | + | |
94 | + public void refresh(int uid) { | |
95 | + Collection<String> targets; | |
96 | + synchronized (mLock) { | |
97 | + targets = mImpl.onSwitchUser(uid); | |
98 | + } | |
99 | + List targeted = new ArrayList(targets); | |
100 | + updateSelectedAssets(uid, targeted); | |
101 | + } | |
102 | }; | |
103 | ||
104 | private boolean isOverlayPackage(@NonNull final PackageInfo pi) { | |
105 | @@ -603,45 +612,48 @@ public final class OverlayManagerService extends SystemService { | |
106 | } | |
107 | ||
108 | @Override | |
109 | - public void onOverlayAdded(@NonNull final OverlayInfo oi) { | |
110 | - scheduleBroadcast(Intent.ACTION_OVERLAY_ADDED, oi, oi.isEnabled()); | |
111 | + public void onOverlayAdded(@NonNull final OverlayInfo oi, final boolean shouldWait) { | |
112 | + scheduleBroadcast(Intent.ACTION_OVERLAY_ADDED, oi, oi.isEnabled(), shouldWait); | |
113 | } | |
114 | ||
115 | @Override | |
116 | - public void onOverlayRemoved(@NonNull final OverlayInfo oi) { | |
117 | - scheduleBroadcast(Intent.ACTION_OVERLAY_REMOVED, oi, oi.isEnabled()); | |
118 | + public void onOverlayRemoved(@NonNull final OverlayInfo oi, final boolean shouldWait) { | |
119 | + scheduleBroadcast(Intent.ACTION_OVERLAY_REMOVED, oi, oi.isEnabled(), shouldWait); | |
120 | } | |
121 | ||
122 | @Override | |
123 | - public void onOverlayChanged(@NonNull final OverlayInfo oi, | |
124 | - @NonNull final OverlayInfo oldOi) { | |
125 | - scheduleBroadcast(Intent.ACTION_OVERLAY_CHANGED, oi, oi.isEnabled() != oldOi.isEnabled()); | |
126 | + public void onOverlayChanged(@NonNull final OverlayInfo oi, @NonNull OverlayInfo oldOi, | |
127 | + final boolean shouldWait) { | |
128 | + scheduleBroadcast(Intent.ACTION_OVERLAY_CHANGED, oi, | |
129 | + oi.isEnabled() != oldOi.isEnabled(), shouldWait); | |
130 | } | |
131 | ||
132 | @Override | |
133 | public void onOverlayPriorityChanged(@NonNull final OverlayInfo oi) { | |
134 | - scheduleBroadcast(Intent.ACTION_OVERLAY_PRIORITY_CHANGED, oi, oi.isEnabled()); | |
135 | + scheduleBroadcast(Intent.ACTION_OVERLAY_PRIORITY_CHANGED, oi, oi.isEnabled(), false); | |
136 | } | |
137 | ||
138 | private void scheduleBroadcast(@NonNull final String action, @NonNull final OverlayInfo oi, | |
139 | - final boolean doUpdate) { | |
140 | - FgThread.getHandler().post(new BroadcastRunnable(action, oi, doUpdate)); | |
141 | + final boolean doUpdate, final boolean shouldWait) { | |
142 | + FgThread.getHandler().post(new BroadcastRunnable(action, oi, doUpdate, shouldWait)); | |
143 | } | |
144 | ||
145 | private final class BroadcastRunnable extends Thread { | |
146 | private final String mAction; | |
147 | private final OverlayInfo mOverlayInfo; | |
148 | private final boolean mDoUpdate; | |
149 | + private final boolean shouldWait; | |
150 | ||
151 | - public BroadcastRunnable(@NonNull final String action, @NonNull final OverlayInfo oi, | |
152 | - final boolean doUpdate) { | |
153 | + public BroadcastRunnable(@NonNull final String action, @NonNull final OverlayInfo oi, | |
154 | + final boolean doUpdate, final boolean shouldWait) { | |
155 | mAction = action; | |
156 | mOverlayInfo = oi; | |
157 | mDoUpdate = doUpdate; | |
158 | + this.shouldWait = shouldWait; | |
159 | } | |
160 | ||
161 | public void run() { | |
162 | - if (mDoUpdate) { | |
163 | + if (mDoUpdate && !shouldWait) { | |
164 | updateAssets(mOverlayInfo.userId, mOverlayInfo.targetPackageName); | |
165 | } | |
166 | sendBroadcast(mAction, mOverlayInfo.targetPackageName, mOverlayInfo.packageName, | |
167 | @@ -672,10 +684,10 @@ public final class OverlayManagerService extends SystemService { | |
168 | private void updateAssets(final int userId, final String targetPackageName) { | |
169 | final List<String> list = new ArrayList<>(); | |
170 | list.add(targetPackageName); | |
171 | - updateAssets(userId, list); | |
172 | + updateSelectedAssets(userId, list); | |
173 | } | |
174 | ||
175 | - private void updateAssets(final int userId, List<String> targetPackageNames) { | |
176 | + private void updateSelectedAssets(final int userId, List<String> targetPackageNames) { | |
177 | final PackageManagerInternal pm = LocalServices.getService(PackageManagerInternal.class); | |
178 | final boolean updateFrameworkRes = targetPackageNames.contains("android"); | |
179 | if (updateFrameworkRes) { | |
180 | diff --git a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java | |
d1b877b3 | 181 | index 4c6196824cf..c5156403b3f 100644 |
6bcbafcd L |
182 | --- a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java |
183 | +++ b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java | |
184 | @@ -324,7 +324,7 @@ final class OverlayManagerServiceImpl { | |
185 | } | |
186 | ||
187 | boolean onSetEnabled(@NonNull final String packageName, final boolean enable, | |
188 | - final int userId) { | |
189 | + final int userId, final boolean shouldWait) { | |
190 | if (DEBUG) { | |
191 | Slog.d(TAG, String.format("onSetEnabled packageName=%s enable=%s userId=%d", | |
192 | packageName, enable, userId)); | |
193 | @@ -340,7 +340,7 @@ final class OverlayManagerServiceImpl { | |
194 | final PackageInfo targetPackage = | |
195 | mPackageManager.getPackageInfo(oi.targetPackageName, userId); | |
196 | mSettings.setEnabled(packageName, userId, enable); | |
197 | - updateState(targetPackage, overlayPackage, userId); | |
198 | + updateState(targetPackage, overlayPackage, userId, shouldWait); | |
199 | return true; | |
200 | } catch (OverlayManagerSettings.BadKeyException e) { | |
201 | return false; | |
202 | @@ -379,6 +379,12 @@ final class OverlayManagerServiceImpl { | |
203 | private void updateState(@Nullable final PackageInfo targetPackage, | |
204 | @NonNull final PackageInfo overlayPackage, final int userId) | |
205 | throws OverlayManagerSettings.BadKeyException { | |
206 | + updateState(targetPackage, overlayPackage, userId, false); | |
207 | + } | |
208 | + | |
209 | + private void updateState(@Nullable final PackageInfo targetPackage, | |
210 | + @NonNull final PackageInfo overlayPackage, final int userId, | |
211 | + final boolean shouldWait) throws OverlayManagerSettings.BadKeyException { | |
212 | if (targetPackage != null) { | |
213 | mIdmapManager.createIdmap(targetPackage, overlayPackage, userId); | |
214 | } | |
215 | @@ -395,7 +401,7 @@ final class OverlayManagerServiceImpl { | |
216 | OverlayInfo.stateToString(currentState), | |
217 | OverlayInfo.stateToString(newState))); | |
218 | } | |
219 | - mSettings.setState(overlayPackage.packageName, userId, newState); | |
220 | + mSettings.setState(overlayPackage.packageName, userId, newState, shouldWait); | |
221 | } | |
222 | } | |
223 | ||
224 | diff --git a/services/core/java/com/android/server/om/OverlayManagerSettings.java b/services/core/java/com/android/server/om/OverlayManagerSettings.java | |
d1b877b3 | 225 | index af0bb64bd67..935ea02890b 100644 |
6bcbafcd L |
226 | --- a/services/core/java/com/android/server/om/OverlayManagerSettings.java |
227 | +++ b/services/core/java/com/android/server/om/OverlayManagerSettings.java | |
228 | @@ -76,7 +76,7 @@ final class OverlayManagerSettings { | |
229 | final OverlayInfo oi = item.getOverlayInfo(); | |
230 | mItems.remove(item); | |
231 | if (oi != null) { | |
232 | - notifyOverlayRemoved(oi); | |
233 | + notifyOverlayRemoved(oi, false); | |
234 | } | |
235 | } | |
236 | ||
237 | @@ -135,7 +135,7 @@ final class OverlayManagerSettings { | |
238 | final OverlayInfo oi = item.getOverlayInfo(); | |
239 | item.setUpgrading(true); | |
240 | item.setState(STATE_NOT_APPROVED_UNKNOWN); | |
241 | - notifyOverlayRemoved(oi); | |
242 | + notifyOverlayRemoved(oi, false); | |
243 | } else { | |
244 | item.setUpgrading(false); | |
245 | } | |
246 | @@ -172,8 +172,8 @@ final class OverlayManagerSettings { | |
247 | return item.getState(); | |
248 | } | |
249 | ||
250 | - void setState(@NonNull final String packageName, final int userId, final int state) | |
251 | - throws BadKeyException { | |
252 | + void setState(@NonNull final String packageName, final int userId, final int state, | |
253 | + final boolean shouldWait) throws BadKeyException { | |
254 | final SettingsItem item = select(packageName, userId); | |
255 | if (item == null) { | |
256 | throw new BadKeyException(packageName, userId); | |
257 | @@ -182,10 +182,10 @@ final class OverlayManagerSettings { | |
258 | item.setState(state); | |
259 | final OverlayInfo current = item.getOverlayInfo(); | |
260 | if (previous.state == STATE_NOT_APPROVED_UNKNOWN) { | |
261 | - notifyOverlayAdded(current); | |
262 | + notifyOverlayAdded(current, shouldWait); | |
263 | notifySettingsChanged(); | |
264 | } else if (current.state != previous.state) { | |
265 | - notifyOverlayChanged(current, previous); | |
266 | + notifyOverlayChanged(current, previous, shouldWait); | |
267 | notifySettingsChanged(); | |
268 | } | |
269 | } | |
270 | @@ -602,32 +602,32 @@ final class OverlayManagerSettings { | |
271 | } | |
272 | } | |
273 | ||
274 | - private void notifyOverlayAdded(@NonNull final OverlayInfo oi) { | |
275 | + private void notifyOverlayAdded(@NonNull final OverlayInfo oi, final boolean shouldWait) { | |
276 | if (DEBUG) { | |
277 | assertNotNull(oi); | |
278 | } | |
279 | for (final ChangeListener listener : mListeners) { | |
280 | - listener.onOverlayAdded(oi); | |
281 | + listener.onOverlayAdded(oi, shouldWait); | |
282 | } | |
283 | } | |
284 | ||
285 | - private void notifyOverlayRemoved(@NonNull final OverlayInfo oi) { | |
286 | + private void notifyOverlayRemoved(@NonNull final OverlayInfo oi, final boolean shouldWait) { | |
287 | if (DEBUG) { | |
288 | assertNotNull(oi); | |
289 | } | |
290 | for (final ChangeListener listener : mListeners) { | |
291 | - listener.onOverlayRemoved(oi); | |
292 | + listener.onOverlayRemoved(oi, shouldWait); | |
293 | } | |
294 | } | |
295 | ||
296 | private void notifyOverlayChanged(@NonNull final OverlayInfo oi, | |
297 | - @NonNull final OverlayInfo oldOi) { | |
298 | + @NonNull final OverlayInfo oldOi, final boolean shouldWait) { | |
299 | if (DEBUG) { | |
300 | assertNotNull(oi); | |
301 | assertNotNull(oldOi); | |
302 | } | |
303 | for (final ChangeListener listener : mListeners) { | |
304 | - listener.onOverlayChanged(oi, oldOi); | |
305 | + listener.onOverlayChanged(oi, oldOi, shouldWait); | |
306 | } | |
307 | } | |
308 | ||
309 | @@ -642,9 +642,10 @@ final class OverlayManagerSettings { | |
310 | ||
311 | interface ChangeListener { | |
312 | void onSettingsChanged(); | |
313 | - void onOverlayAdded(@NonNull OverlayInfo oi); | |
314 | - void onOverlayRemoved(@NonNull OverlayInfo oi); | |
315 | - void onOverlayChanged(@NonNull OverlayInfo oi, @NonNull OverlayInfo oldOi); | |
316 | + void onOverlayAdded(@NonNull OverlayInfo oi, boolean shouldWait); | |
317 | + void onOverlayRemoved(@NonNull OverlayInfo oi, boolean shouldWait); | |
318 | + void onOverlayChanged(@NonNull OverlayInfo oi, @NonNull OverlayInfo oldOi, | |
319 | + boolean shouldWait); | |
320 | void onOverlayPriorityChanged(@NonNull OverlayInfo oi); | |
321 | } | |
322 | ||
323 | diff --git a/services/core/java/com/android/server/om/OverlayManagerShellCommand.java b/services/core/java/com/android/server/om/OverlayManagerShellCommand.java | |
d1b877b3 | 324 | index d6f53737913..44004c140a4 100644 |
6bcbafcd L |
325 | --- a/services/core/java/com/android/server/om/OverlayManagerShellCommand.java |
326 | +++ b/services/core/java/com/android/server/om/OverlayManagerShellCommand.java | |
327 | @@ -25,8 +25,10 @@ import android.os.ShellCommand; | |
328 | import android.os.UserHandle; | |
329 | ||
330 | import java.io.PrintWriter; | |
331 | +import java.util.ArrayList; | |
332 | import java.util.List; | |
333 | import java.util.Map; | |
334 | +import java.util.Map.Entry; | |
335 | ||
336 | /** | |
337 | * Implementation of 'cmd overlay' commands. | |
338 | @@ -45,7 +47,9 @@ final class OverlayManagerShellCommand extends ShellCommand { | |
339 | @Override | |
340 | public int onCommand(@Nullable final String cmd) { | |
341 | if (cmd == null) { | |
342 | - return handleDefaultCommands(cmd); | |
343 | + final PrintWriter out = getOutPrintWriter(); | |
344 | + out.println("The overlay manager has already been initialized."); | |
345 | + return -1; | |
346 | } | |
347 | final PrintWriter err = getErrPrintWriter(); | |
348 | try { | |
349 | @@ -56,6 +60,8 @@ final class OverlayManagerShellCommand extends ShellCommand { | |
350 | return runEnableDisable(true); | |
351 | case "disable": | |
352 | return runEnableDisable(false); | |
353 | + case "disable-all": | |
354 | + return runDisableAll(); | |
355 | case "set-priority": | |
356 | return runSetPriority(); | |
357 | default: | |
358 | @@ -82,10 +88,12 @@ final class OverlayManagerShellCommand extends ShellCommand { | |
359 | out.println(" Overlay packages are printed in priority order. With optional"); | |
360 | out.println(" parameters PACKAGEs, limit output to the specified packages"); | |
361 | out.println(" but include more information about each package."); | |
362 | - out.println(" enable [--user USER_ID] PACKAGE"); | |
363 | - out.println(" Enable overlay package PACKAGE."); | |
364 | - out.println(" disable [--user USER_ID] PACKAGE"); | |
365 | - out.println(" Disable overlay package PACKAGE."); | |
366 | + out.println(" enable [--user USER_ID] [PACKAGE [PACKAGE [...]]]"); | |
367 | + out.println(" Enable overlay package PACKAGE or subsequent counts of PACKAGE."); | |
368 | + out.println(" disable [--user USER_ID] [PACKAGE [PACKAGE [...]]]"); | |
369 | + out.println(" Disable overlay package PACKAGE or subsequent counts of PACKAGE."); | |
370 | + out.println(" disable-all [--user USER_ID]"); | |
371 | + out.println(" Disable all overlay packages."); | |
372 | out.println(" set-priority [--user USER_ID] PACKAGE PARENT|lowest|highest"); | |
373 | out.println(" Change the priority of the overlay PACKAGE to be just higher than"); | |
374 | out.println(" the priority of PACKAGE_PARENT If PARENT is the special keyword"); | |
375 | @@ -145,8 +153,90 @@ final class OverlayManagerShellCommand extends ShellCommand { | |
376 | } | |
377 | } | |
378 | ||
379 | - final String packageName = getNextArgRequired(); | |
380 | - return mInterface.setEnabled(packageName, enable, userId) ? 0 : 1; | |
381 | + int argc = 0; | |
382 | + String packageName = getNextArgRequired(); | |
383 | + ArrayList<String> packages = new ArrayList<>(); | |
384 | + if (packageName == null) { | |
385 | + System.err.println("Error: no packages specified"); | |
386 | + return 1; | |
387 | + } | |
388 | + while (packageName != null) { | |
389 | + argc++; | |
390 | + packages.add(packageName); | |
391 | + packageName = getNextArg(); | |
392 | + } | |
393 | + if (argc > 1) { | |
394 | + for (String pkg : packages) { | |
395 | + boolean ret = mInterface.setEnabled(pkg, enable, userId, false); | |
396 | + if (!ret) { | |
397 | + System.err.println("Error: Failed to " + ((enable) ? "enable ": "disable ") + pkg); | |
398 | + } | |
399 | + } | |
400 | + return 0; | |
401 | + } else if (argc == 1) { | |
402 | + return mInterface.setEnabled(packages.get(0), enable, userId, false) ? 0 : 1; | |
403 | + } else { | |
404 | + System.err.println("Error: A fatal exception has occurred."); | |
405 | + return 1; | |
406 | + } | |
407 | + } | |
408 | + | |
409 | + private int runDisableAll() { | |
410 | + int userId = UserHandle.USER_OWNER; | |
411 | + String opt; | |
412 | + while ((opt = getNextOption()) != null) { | |
413 | + switch (opt) { | |
414 | + case "--user": | |
415 | + userId = UserHandle.parseUserArg(getNextArgRequired()); | |
416 | + break; | |
417 | + default: | |
418 | + System.err.println("Error: Unknown option: " + opt); | |
419 | + return 1; | |
420 | + } | |
421 | + } | |
422 | + | |
423 | + try { | |
424 | + Map<String, List<OverlayInfo>> targetsAndOverlays = mInterface.getAllOverlays(userId); | |
425 | + int iterator = 0; | |
426 | + int overlaySize = targetsAndOverlays.entrySet().size(); | |
427 | + for (Entry<String, List<OverlayInfo>> targetEntry : targetsAndOverlays.entrySet()) { | |
428 | + int iterator_nested = 0; | |
429 | + int targetSize_nested = targetEntry.getValue().size(); | |
430 | + iterator++; | |
431 | + for (OverlayInfo oi : targetEntry.getValue()) { | |
432 | + if (iterator_nested < targetSize_nested) { | |
433 | + if (oi.isEnabled()) { | |
434 | + boolean worked = mInterface.setEnabled(oi.packageName, false, userId, true); | |
435 | + if (!worked) { | |
436 | + System.err.println("Failed to disable " + oi.packageName); | |
437 | + } | |
438 | + } | |
439 | + } else { | |
440 | + if (iterator == overlaySize) { | |
441 | + if (oi.isEnabled()) { | |
442 | + boolean worked = mInterface.setEnabled(oi.packageName, false, userId, false); | |
443 | + if (!worked) { | |
444 | + System.err.println("Failed to disable " + oi.packageName); | |
445 | + } | |
446 | + } | |
447 | + } else { | |
448 | + if (oi.isEnabled()) { | |
449 | + boolean worked = mInterface.setEnabled(oi.packageName, false, userId, true); | |
450 | + if (!worked) { | |
451 | + System.err.println("Failed to disable " + oi.packageName); | |
452 | + } | |
453 | + } | |
454 | + } | |
455 | + } | |
456 | + iterator_nested++; | |
457 | + } | |
458 | + } | |
459 | + mInterface.refresh(userId); | |
460 | + } catch (RemoteException re) { | |
461 | + System.err.println(re.toString()); | |
462 | + System.err.println("Error: A fatal exception has occurred."); | |
463 | + } | |
464 | + return 0; | |
465 | } | |
466 | ||
467 | private int runSetPriority() throws RemoteException { | |
468 | -- | |
d1b877b3 | 469 | 2.11.1 |
6bcbafcd | 470 |