Do not call Configuration.setLocales(empty LocaleList) if the locale
list is empty since Configuration.setLocales calls setLayoutDirection
which resets the layout to LTR.
Bug: 27411138
Change-Id: I7fa9693cdb7ed90267f074812c26ea50314ad839
If we have an existing file in the destination directory, which has the
same name with the source file, adding suffix number is
DocumentsProvider's responsibility.
Because MTP does not provide a way to check existance of files with
given name, the logic is implemented as try-and error strategy. The CL
lets If we MtpDocumentsProvider assume we have a file that shares the
same name with the source file if it failed to invoke
MtpDevice#sendObjectInfo. In this case MtpDocumentsProvider retry to
invoke sendObjectInfo with new name with suffix number.
BUG=26991190
Change-Id: I223ac5031f079bc91eb27709b0356f621a1ed55b
* changes:
Add more @NonNull/@Nullable to TextServicesSettings.
Remove an unnecessary int to String conversion.
Add more @NonNull/@Nullable to InputMethodSettings.
This is a safe refactoring to remove an unnecessary int to String
conversion in TextServicesSettings.
Settings.Secure.SELECTED_SPELL_CHECKER_SUBTYPE is a integer value that
indicates subtype ID (or SpellCheckerSubtype#hashCode() if the subtype
ID is not specified), and we can just rely on
Settings.Secure#putIntForUser() rather than converting int to String
by ourselves then pass it to Settings.Secure#putStringForUser().
Note that this change is still OK for existing users because
Settings.Secure#putIntForUser() has been internally doing exactly the
same thing.
Bug: 27687531
Change-Id: Ibcf12746f1295c12bec095300ea7f6ced0a51d09
This follows up to a previous CL [1] for Bug 26279466.
It turns out that we have not clearly defined how nonexistent key should
be handled in InputMethodSettings#getEnabledInputMethodsStr(), e.g. it
returns "" for when mCopyOnWrite is true but returns null when
mCopyOnWrite is false.
Also, since InputMethodSettings now can revert changes made during
mCopyOnWrite is true, the caller may also start receiving null in the
following scenario.
1. call mSettings.switchCurrentUser(userId, true).
2. call mSettings.putEnabledInputMethodsStr(str) where str is non-null.
3. call mSettings.switchCurrentUser(userId, false).
4. call mSettings.getEnabledInputMethodsStr().
If the caller of getEnabledInputMethodsStr() has assumed that it would
never return null, then it would start crashing due to NPE.
With this CL, getEnabledInputMethodsStr() is marked to be @NonNull we
should no longer see such kind of NPE.
[1]: I9c6f9bb3d51174198e5f73588637f87ea0d90e11
68645a638a
Bug: 27687531
Change-Id: I169ad4957e68b65c64251b0849056195b8ca4911
This is needed to change the default launcher on CTS for
ShortcutManager.
- When the default set with DPM.addPersistentPreferredActivity() is
still stronger.
- Ideally we should unify the code with HomeSettings, but I couldn't
find a good way to do this.
- I didn't make it to work to set the default for any intents
because building an intent filter from a command line would be
painful.
Bug 27548047
Change-Id: I66b153c20c7796147f77214b483112629f9d80c5
- Consolidates the use of handles in context hub, and nano apps.
- Quick fixes to typos.
- Update the signature to find nano apps to use primitive types
Change-Id: Icffa6fa86e0e33a536516d98bc4674c0a39b2163
It's easy for apps to throw custom Parcelables into Bundles, but
if the system tries peeking inside one of these Bundles, it triggers
a BadParcelableException. If that Bundle was passed away from the
Binder thread that delivered it into the system, we end up with a
nasty runtime restart.
This change mitigates this trouble by "defusing" any Bundles parsed by
the system server. That is, if it encounters BadParcelableException
while unpacking a Bundle, it logs and delivers an empty Bundle as
the result.
Simultaneously, to help catch the system process sticking its
fingers into Bundles that are destined for other processes, a Bundle
now tracks if it's "defusable." For example, any Intents delivered
through ActivityThread are marked as being defusable, since they've
arrived at their final destination. Any other Bundles are considered
to be "in transit" and we log if the system tries unparceling them.
Merges several Parcel boolean fields into a flags int. Add better
docs to several classes.
Bug: 27581063
Change-Id: I28cf3e7439503b5dc9a429bafae5eb48f21f0d93
Change the args for onVisibilityAggregated to a single boolean for
visibility to the user. Also fix an ordering bug that could trigger a
view background drawable call to setVisible before the view would
respond true to verifyDrawable, which caused issues with some apps.
Bug 27461617
Bug 27689884
Change-Id: I58bdc7c4364264f7fa0863689ba2b76df904ef81
This change fixes a race condition when two SystemSensorManager
instances are initialized the same time.
Bug: 27334914
Change-Id: I7a886abcbff2ed6f8abf87556a78d1a4afb71f91
1. Instead of getting application info in runtime, just retrieve the
one in the context to avoid cross user operation.
2. Functions in PackageManager that retrieve badged icon now return
badged icon if the targer user is managed profile instead of checking
whether target user is a managed profile of the user in mContext.
3. Relax the restriction of getUserInfo, if the caller is asking a user
in the same profile group or having the manage user permission, we let
it go.
Bug: 26469166
Change-Id: Ia1ffc5743f7d94bd489cdb7571eaed51499ebdd9