Commit Graph

230 Commits

Author SHA1 Message Date
Fan Zhang
c3fd289969 Remove dead code.
Bug: n/a
Test: rebuild
Change-Id: I71f8d9d99bbff1186e8df518ec8d27db3447ffbe
2019-01-29 16:27:31 -08:00
Raff Tsai
2928cd4c72 Fix Settings crash after disabling Settings Suggestion
- Settings Suggestion App is responsible for searching, we can not
prevent user disable it. Hide search feature if user disable it.

Fixes: 118805907
Fixes: 117921464
Test: manual
Change-Id: I61c47c52265a6efd79ef2fa60272bf6513e678b1
2018-11-07 14:11:23 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Aarthi Balachander
d0f835981c Use the migrated injected setting code in settingslib.
Manual merge to master from pi-car-dev
Bug: 68198078
Test: Tested on device
Change-Id: Iff767cd6bf7408b45ce9594628d3fd0a71744e9f
2018-07-18 13:34:25 -07:00
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Kevin Chyn
4882e875ae 1/n Start adding Face settings (base, intro)
This change refactors common biometric settings code as well to minimize
duplicated code in areas such as:
    Preference Controller
    EnrollBase
    EnrollIntro

This change also updates ChooseLock to have Face + Pin/Pattern/Pass

Bug: 110589286

Test: Fingerprint settings/enrollment still works
Test: make -j56 RunSettingsRoboTests
Change-Id: Ie35406a01b85617423beece42683ac086e9bc4a7
2018-06-29 18:19:34 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
aab36de0d6 Remove wrapper for device policy manager
Bug: 76167422
Test: robotests
Change-Id: I69dc7341cf1ff408bc24c2a062586cef25b7b918
2018-03-30 20:44:20 -07:00
Fan Zhang
1b9b1a2311 Remove FingerprintManagerWrapper
No longer needed after robolectric migration

Bug: 76167422
Test: robotests
Change-Id: I922cde8ac3667081a512cf899af86f68b24485a6
2018-03-30 16:30:31 -07:00
Tony Mak
4e29281b99 Fix user id is not used correctly when fetching app info
FIXES: 73994288
Test: m -j RunSettingsRoboTest
Test: Install an app in work profile, set it to be restricted,
      observe that the app is rendered properly in restricted app list

Change-Id: Ic8a79eb3d0a675f9d1cae3125e8006739e492966
2018-03-19 20:31:17 +00:00
Phil Weaver
5a3e02dd38 Don't pre-scale vector drawables in settings
The idea of scaling down icons to prevent the system from
dealing with large images seems to be catching some
VectorDrawables and rescaling them. I don't think
VectorDrawables are likely to create a memory issue,
and the protection code seemed to be added to protect
against large pngs, not vector graphics.

Bug: 70562945
Test: Visually verified that all icons in the Accessibility
Shortcut list are now the same size with maximum display
and font sizes.

Change-Id: I9f177d11a614c122d333d4625bf6fa756d1bf4af
2018-03-08 17:38:46 -08:00
TreeHugger Robot
c26ea56fe4 Merge "Get rid of direct usage of Utils.onBuildStartFragmentIntent" 2018-02-20 21:03:04 +00:00
Fan Zhang
e5b8a5b24f Merge changes I34732bdb,Ieafd3be6
* changes:
  Remove some unused code
  Remove unused slice metadata
2018-02-20 20:02:29 +00:00
Fan Zhang
deec75fa9d Remove some unused code
Bug: n/a
Test: rebuild
Change-Id: I34732bdbf59d8380bef50f9a5da8b974375ea345
2018-02-20 10:18:54 -08:00
Fan Zhang
1f6d24a991 Get rid of direct usage of Utils.onBuildStartFragmentIntent
Change-Id: I87eb97d6da4cd4f99be5bcdb1e3e245eb1c7bd1c
Fixes: 73250851
Test: robotests
2018-02-20 09:42:31 -08:00
Fan Zhang
47854c2945 Migrate more places to subsetting launcher
Bug: 73250851
Test: robotests
Change-Id: Iaf29df45ddb42fd58f181cb01e10998a97cb7c34
2018-02-19 14:21:05 -08:00
Fan Zhang
3fff7bc35f Move some subsetting launch to SubSettingLauncher
Bug: 73250851
Test: robotests
Change-Id: I1c3620d335eaf99bb110bcbb3e33ff3b2a05f84e
2018-02-15 16:40:06 -08:00
Fan Zhang
615563db0c Migrate more subsetting launching to SubSettingLauncher
Bug: 73250851
Test: robotests
Change-Id: Ic0bf23f6ac6f717bdd3d477fdb84af68badae8e6
2018-02-15 15:39:56 -08:00
Fan Zhang
2ecef333e9 Refactor Utils.startWithFragment to SubSettingLauncher
- Use the new launcher in AccountTypePrefernce for now. Will migrate the
  rest in follow up CLs.

Change-Id: I67aa49f54b39ecea4ecfdc32ccbd827d21fc79b8
Bug: 73250851
Test: robotest
2018-02-15 15:04:04 -08:00
Salvador Martinez
408dc41228 Update copy for battery estimate related features
Many features are using the enhanced estimates but the copy for them
has gotten out of sync. This CL moves shared strings between Settings
and SysUI to SettingsLib and also updates features that use the
strings to have consistent behavior/text.

Test: Robotests
Bug: 65656091
Bug: 66909350
Bug: 67469159
Change-Id: Ie5ef1ed65429ca9805cff374f1439e5d61eb6591
2018-02-07 10:55:15 -08:00
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
TreeHugger Robot
e3f187a4a9 Merge "Revert "Migrate to use instrumentation classes from settingslib."" 2018-01-23 01:58:18 +00:00
Fan Zhang
b7270a5aeb conditionally add FLAG_ACTIVITY_NEW_TASK when starting page
Subsettings must be started from Activity context, apparently.

Add a flag when it's not started from Activity context. This might not
be catching all cases but should at lesat cover most of them.

Change-Id: I8157ec0cb3d032bb44a0e7dec36637906fc8f1a0
Fixes: 72314527
Test: monkey
2018-01-22 14:07:52 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08:00
jackqdyulei
fde637ff60 Add BatteryTipDialogFragment.
This DialogFragment handles all the tip related dialogs. This cl makes:
1. All the tips parcelable.
2. Add dialog for HighUsageTip. It also need adapter to populate app
list in dialog.
3. Add and update tests

Bug: 70570352
Test: RunSettingsRoboTests
Change-Id: Ie4c986172cfc73d8746abc7457d966c8600c6145
2018-01-09 17:33:19 -08:00
Fan Zhang
cf97f0b643 Add tests for some security setting controllers
Bug: 32953042
Test: robotests
Change-Id: Ieab4e6434bbb80313f6d1b25ff1cdea5713038f0
2018-01-05 15:45:53 -08:00
Jeff Sharkey
219ec91e1a Unlock all users before moving or migrating.
When moving apps or shared storage between storage media on FBE
devices, we need all users to be unlocked to successfully move
the data.  This change asks the user to enter the credentials for
any locked users as part of the moving/migration wizard flows.

To do this we relax Utils.enforceSameOwner() to let us prompt for the
credentials of unrelated users, but we carefully only extend this
capability to callers interacting with the "internal" activities,
which require the MANAGE_USERS permission.

Test: builds, boots, users are unlocked before moving
Bug: 29923055, 25861755
Change-Id: Ifaeb2557c4f8c4354e1d380eaa0e413768ee239f
2017-12-19 15:07:05 -07:00
Fan Zhang
5c1e686d3f Merge "Update app icon for ManageDomainUrls setting" 2017-11-09 20:52:57 +00:00
Fan Zhang
4e540db06d Update app icon for ManageDomainUrls setting
Change-Id: I6c26a055983ea72049d1633336d6da8736a78fa0
Fixes: 69057114
Test: robotests
2017-11-09 11:02:23 -08:00
Ajay Nadathur
d473e38c74 Forward wallpaper activity results to the caller.
- Added Activity.FLAG_ACTIVITY_FORWARD_RESULT to the intent that
launches the wallpaper activities.
- WallpaperSuggestionActivity also finishes itself after launching
intent.

Bug: 65691577
Test: Added robolectric test. Also verified manually that result code is
being forwarded
Change-Id: I2f8b0fac7a35c38e14c4a733b7552fd2e58dd0db
2017-11-08 11:03:04 -08:00
Tony Mantler
d9af0b839d Move SimStatus and ImeiInfo Pref Controllers to SettingsLib
Bug: 67410808
Test: RunSettingsRoboTests
Change-Id: Ib55d2365814b5882f7fcae6bb7f1b62cc3d6ad4e
2017-10-23 15:42:43 -07:00
Felipe Leme
bd88450183 Adds a Util.setSafeIcon() function used to avoid crashes.
There are many places on Settings that loads an icon provided by an application,
and if the icon is too big it crashes Settings.

This CL creates a helper method used to set an icon in a safe way, and
uses it in a few places (but most likely not all of them).

Bug: 65739885
Test: manual verification with an app providing a 2MB png

Change-Id: Iae2becb6d0ec8893328d9ef1de618f9bd12fa4a0
2017-10-10 08:56:56 -07:00
PMS22
63a0560a6c Settings: Correctly align cursor in Settings
Steps to Reproduce:
- Click on Density Settings (DPI Settings) / Renaming BT Device / Renaming SIM Settings
- EditText Dialog pops up
- The cursor is at the leftmost side of the text
- Logically Cursor should be at rightmost side which can be aligned grabbing text length

Screenshots:
Before:
http://imgur.com/a/o4vkr
http://imgur.com/a/6Qext

After:
http://imgur.com/a/fuxqT
http://imgur.com/a/vm2WX

Bug: 65185652
Test: RunSettingsRoboTests: OK (47 tests)

Change-Id: Id00308e7e019434edad4afab56cf4719be0d0d54
Signed-off-by: PMS22 <prathams99@rediff.com>
2017-09-27 14:12:32 -07:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
Roozbeh Pournader
4de9df2943 Define Utils.formatRelativeTime() and use it
Previously, relative times were formatted using formatElapsedTime()
(appending translations of "ago" to them), sometimes resulting in
grammatically hard-to-understand or unnatural localizations. Now we
use ICU's RelativeDateTimeFormatter, which uses grammatically correct
and natural localizations from CLDR data.

Bug: 64507689
Bug: 64605781
Bug: 64556849
Bug: 64550172
Test: make -j RunSettingsRoboTests
Change-Id: Ia2d098b190ab99e7748ef6f03b919f5c6174ba7d
2017-09-12 20:48:00 +00:00
jackqdyulei
00015fbf50 Add device/profile app check in background check
If app is device or profile app, we disable the background check
toggle. This cl also create an util method for this check and
remove duplicate code

Bug: 64665807
Test: RunSettingsRoboTests
Change-Id: Id8336eadaac8832327bc3653aaa7dfbacde352ac
2017-08-29 16:10:36 -07:00
Justin Klaassen
3025727e16 Ask device owner for master clear in demo mode
Bug: 62712426
Test: make RunSettingsRoboTests -j19
Change-Id: I29f92ff1062590f2c5eb7713e5969da7870fc582
2017-08-09 10:44:19 -07:00
Christine Franks
a1f56b5faa Merge "Restrict changing wi-fi networks" into oc-dr1-dev
am: a7e10e0316

Change-Id: Ifcb15f741c4bcb72c32789870bc50027d2fc4cbb
2017-07-26 02:52:52 +00:00
Christine Franks
a0dd987d20 Restrict changing wi-fi networks
Bug: 31852835
Test: manual - verify unrestricted as regular user, but that a password
is required in demo mode.
Change-Id: I60f95ccbb10ba728b384b9c8c2ae723934fb2928
2017-07-25 13:31:12 -07:00
Kevin Chyn
2a2dcb52cb Fingerprint swipe settings and suggestions should not show if hardware unavailable
Fixes: 63589121

Test: remove FP driver, make sure swipe setting and suggestions
don't show anymore && make -j RunSettingsRoboTests

Merged-In: I2539128daff8df52d040606141f772fc9edffa57
Change-Id: I2539128daff8df52d040606141f772fc9edffa57
2017-07-25 02:33:30 +00:00
Kevin Chyn
82792cc5b3 Fingerprint swipe settings and suggestions should not show if hardware unavailable
Fixes: 63589121

Test: remove FP driver, make sure swipe setting and suggestions
don't show anymore && make -j RunSettingsRoboTests

Change-Id: I2539128daff8df52d040606141f772fc9edffa57
2017-07-24 13:40:34 -07:00
Christine Franks
c6890ab6c5 Move logic for FR in demo mode out of Settings
Bug: 62712426
Test: make \
ROBOTEST_FILTER="(MasterClearTest|FactoryResetPreferenceControllerTest
|UtilsTest)" \
RunSettingsRoboTests -j100
Change-Id: I5e287c3d4a6a7050bda78187c52aec19e90b50bc
2017-07-21 19:19:19 +00:00
Christine Franks
a09eb383d9 Move logic for FR in demo mode out of Settings
Bug: 62712426
Test: make \
ROBOTEST_FILTER="(MasterClearTest|FactoryResetPreferenceControllerTest
|UtilsTest)" \
RunSettingsRoboTests -j100
Change-Id: I5e287c3d4a6a7050bda78187c52aec19e90b50bc
2017-07-20 17:44:18 -07:00
Phil Weaver
633c9be21c Migrate to new overlay-stopping flag
Bug: 62196835
Test: Started an accessibility service that displays an app
overlay and verified that it disappears when approving an
accessibility service's capabilities.

Change-Id: I7c8d8b4143a5dd1cb684c31c4503608c8d5be0e3
2017-07-05 10:41:18 -07:00
Fan Zhang
896f1b363c Reduce jank around loading view when opening data usage UI
Change-Id: I3d23d8160b046de8fe125ba0697b7b3d7786453c
Fix: 28181319
Test: robotests
2017-06-26 15:15:30 -07:00
TreeHugger Robot
03849d1484 Merge "Switch Utils.formatElapsedTime to use ICU's MeasureFormat" 2017-06-22 19:49:35 +00:00
Roozbeh Pournader
1587224193 Switch Utils.formatElapsedTime to use ICU's MeasureFormat
Previously, localizable strings were used instead, causing various
difficulties and inconsistencies.

Now we use ICU's MeasureFormat. The results for English are almost
identical to the previous results (see below), and we also get higher
quality and better-vetted results for other locales.

Note: This also makes formatted strings shorter by eliminating zeros.
For example, what was previously shown as "2d 0h 15m" is now shown as
"2d 15m".

Bug: 36994779
Bug: 37701311
Test: make -j RunSettingsRoboTests
Change-Id: I78fd09e4e7f63f41ef88d3d3fc4ba2be15e1d812
2017-06-21 21:04:37 -07:00
Doris Ling
e9060a3cb6 Delay showing the loading progress spinner in Managed App.
In warm load, the app list is populated much faster, and we should not
show the spinner if we can show the app list immediately.

Adding 100ms delay in showing the loading container. If the app list is
ready, show the list container directly without first showing the
loading container.

Change-Id: I8b3ea88d2382ece9226d5c7734fd1aa406160cf2
Fix: 36375109
Test: make RunSettingsRoboTests
2017-06-19 10:57:11 -07:00