Commit Graph

56 Commits

Author SHA1 Message Date
Fan Wu
353cfc1b08 Check the permission of the callingUid instead of the calling package
Bug: 372671447
Test: atest
Flag: EXEMPT bug fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e719575e92c1e6bd0b9088663e6c909bccf2b007)
Merged-In: Ib36c0a3ba482bcddd53c2c09409ea818e6f43cad
Change-Id: Ib36c0a3ba482bcddd53c2c09409ea818e6f43cad
2025-01-08 18:56:32 -08:00
Fan Wu
964908bc14 Checks cross user permission before handling intent
Bug: 326057017

Test: atest

Flag: EXEMPT bug fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d3b3edd45167515579ab156533754e56ac813f35)
Merged-In: I3444e55b22b7487f96b0e3e9deb3f844c4c4723a
Change-Id: I3444e55b22b7487f96b0e3e9deb3f844c4c4723a
2024-08-29 17:37:08 +00:00
Jonathan Scott
e0d439472f Allow Device Management Role Holder to update Settings strings.
Test: manual
Bug: 188414370
Change-Id: I6e1a06619799a9e99382d791e72e2e4518f93cac
2022-01-25 19:03:24 +00:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
104ee2e423 Add intent filter to launch usage access for app.
Change-Id: Ide8aa590f9b4218d0f4affe65a7daec384480798
Fixes: 110200770
Test: adb shell am start -a android.settings.USAGE_ACCESS_SETTINGS -d package:com.android.settings
2018-09-20 16:44:54 -07:00
Philip P. Moltmann
e3f721132a RestrictedLockUtils was split into ...Internal
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.

This causes a lot of trivial code changes.

I also updated the ordering of the imports in all affected files.

Bug: 110953302
Test: Built
      make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
2018-08-30 08:11:39 -07: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
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -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
hjchangliao
e86eec0c07 Rename SubSettingLauncher.setTitle, add java doc
For make this method usage more clear,
setTitle(charSequence) rename as setTitleText,
add java doc: it is only for user generated string
setTitle(int) rename as setTitleRes.

Change-Id: I972cb6a8ff90873dfdc25c23f6dc3d68103c8e4e
Fixes: 78347436
Test: make RunSettingsRoboTests
2018-05-09 10:00:05 +08: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
Tracy Zhou
8ce416977c Correct picture-in-picture setting behavior for managed profile.
- Show picture-in-picture setting in the app info page for managed
profile.
- Navigate to work app setting instead of non-work app setting on
tapping setting icon from picture-in-picture window. This requires
correctly processing passed-in UserHandle to fetch the right package
info.

Bug: 71592457
Test: make RunSettingsRoboTests
Change-Id: Id3dd04e88a57ae3d8c319c17615992637128589b
2018-02-22 16:00:28 -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
tiansiming
8e3e611755 Merge "Fix NPE crash in AppInfoBase" am: e49cc3d659 am: abcb069d95
am: b5697b2d45

Change-Id: I5e40dde6e0f98a8ba046df78f9b9e3ddcc3f2ce9
2018-01-18 02:34:11 +00:00
tiansiming
81469702f3 Fix NPE crash in AppInfoBase
This crash can hardly happen under the normal operation of the user,
but it may have a chance to appear in monkey test. To enhance the 
robustness of the program, intent.getData() here should not be null 
in any situations.

Bug: N/A
Test: adb shell am start -n
'com.android.settings/.Settings\$AppDrawOverlaySettingsActivity'

Change-Id: I732b564056e3e585405f146d99efe3b410edbc41
Signed-off-by: tiansiming <tiansiming@xiaomi.com>
2018-01-17 18:13:47 +00:00
Fan Zhang
a8cac7a409 Move ManageApplications to sub package and remove dead code
Bug: 64804294
Test: rerun test
Change-Id: I23cbd8da9b65f52470030ba3b9b676ece2bada11
2017-10-12 13:48:54 -07:00
Tony Mantler
2d479598f0 Merge "Make ApplicationsState.Session lifecycle-aware" 2017-09-27 18:22:03 +00:00
Tony Mantler
76cbd4b3b2 Make ApplicationsState.Session lifecycle-aware
Bug: 66682989
Test: RunSettingsRoboTests
Change-Id: Idf56788fcae22639b7bf604a8c73cd5f0ff2da16
2017-09-22 11:23:17 -07:00
Doris Ling
744ff5c607 Merge "Fix NPE crash in UsageAccessDetails" am: cd959f28a0 am: 296c46404c am: c13415391b
am: 913d1667ce

Change-Id: Ib859bec6cd9ca1422856d091fc7a0b9894397b04
2017-09-21 19:31:54 +00:00
Doris Ling
913d1667ce Merge "Fix NPE crash in UsageAccessDetails" am: cd959f28a0 am: 296c46404c
am: c13415391b

Change-Id: I8e5050b2b4c5884b93ef56155f50d1fffcc13579
2017-09-21 19:29:53 +00:00
Doris Ling
296c46404c Merge "Fix NPE crash in UsageAccessDetails"
am: cd959f28a0

Change-Id: I21f898f7ec8fd67d4f29d73491b4ac57cad7a252
2017-09-21 19:24:52 +00:00
tiansiming
39de7aedee Fix NPE crash in UsageAccessDetails
mPackageInfo will be null in RefreshUI method in UsageAccessDetails.java

Bug:https://issuetracker.google.com/issues/65872768
Test:As explained in the link above

Change-Id: I8bd4b822cfe5d8a3347ca7f5886605cbdfb9b8b6
Signed-off-by: tiansiming <tiansiming@xiaomi.com>
2017-09-21 14:12:50 +08: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
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
Fan Zhang
2c6634a8a9 Fix a crash in AppInfoBase where appEntry is invalid
Change-Id: Ifbea967405ddc1e1bd069ddeab170bc67b1835b4
Fix: 63178369
Test: robotests
2017-07-06 17:56:47 +00:00
Fan Zhang
77ee0b08dd Add method to disable "disable" button in installed app UI
OEMs can now force grey out the "disable" button for important apps on
device.

Change-Id: I8ea431b52e50e424be55946f70175db5412e2f4a
Merged-In: Ic075a07ad12592bd60238c7b1c9ab84932c8db3c
Fix: 38250742
Test: make RunSettingsRoboTests
2017-05-31 12:16:49 -07:00
Fan Zhang
a45f3d2f33 Add method to disable "disable" button in installed app UI
OEMs can now force grey out the "disable" button for important apps on
device.

Change-Id: Ic075a07ad12592bd60238c7b1c9ab84932c8db3c
Fix: 38250742
Test: make RunSettingsRoboTests
2017-05-31 11:53:29 -07:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08:00
Amith Yamasani
21556cdba1 Adapt to behavior change in MATCH_UNINSTALLED_PACKAGES
Don't use the PM flag to reach across users.
If retrieving labels, etc., use MATCH_ANY_USER, since
several Settings screens show work profile apps as well.

Bug: 31000380
Test: Manual test of affected screens
Change-Id: Ib6f981ae8443f640276d395c37247c8c0b610894
2016-11-30 13:24:54 -08:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Fan Zhang
1e516287bd Add visibility metrics to dialogs.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Change-Id: I199d2e1b2cb8588a562b46bb8128d8ece24952f0
2016-09-19 17:34:12 -07:00
Doris Ling
36e953fbe5 Fix crash in Storage app info when the corresponding app is uninstalled
in the background.

1. Move the handling for package removal from InstalledAppDetails to
AppInfoBase so that all app info subclass will now finish
correspondingly if the package is uninstalled.
2. In InstalledAppDetails, when handling package removal, will also
finish the app info fragment that it starts earlier.

Change-Id: Id741e7475414045040dd0797ff3bc63ac214f400
Fixes: 27774473
2016-08-12 15:25:00 -07:00
Jason Monk
2108d361bb Add default app prefs to app info
This makes them easier to discover and to know the state of them.

Bug: 27276982
Change-Id: I24a9d34d7e189b19df39cc0b9028b6412f76aa05
2016-02-24 08:55:01 -05:00
Sudheer Shanka
9e9e63b7b3 Part3 - Don't add padlock if the restriction is not set by admin.
Bug: 26687435
Change-Id: Ibfea6d7d5bd32e7a05dcc2cc32b121c9e50b6a34
2016-02-16 11:04:11 +00:00
Sudheer Shanka
ef550767b0 Trigger a support dialog when an action is disabled by policy
Change-Id: I847b481a16cce33fe7bd4040d38ec50ca62172c2
2016-01-20 21:00:44 +00:00
Jason Monk
ae969d7197 Merge "fix out of memory with continuous entry and exit InstalledAppDetail." am: d298d474e6
am: dfc6e32434

* commit 'dfc6e32434a0d208403f8ce754e079e77e34cf7f':
  fix out of memory with continuous entry and exit InstalledAppDetail.
2016-01-04 14:44:25 +00:00
daqiangx
2396a40c90 fix out of memory with continuous entry and exit InstalledAppDetail.
A session keeps in ApplicationsState list. The fragment don't release
the session when it is destroyed. The cause of out of memory is that the
session list is increased, but it can't be released.

Change-Id: I23635610c9fdfb8a3423299a91cf9b11cb5cdb65
Signed-off-by: daqiangx <daqiangx.li@intel.com>
2016-01-04 13:40:28 +08:00
Julia Reynolds
e492ee06ad Make the app header bar more consistent.
- Don't include info link if just came from app info page
- include back button on app info page when launched from header
Bug: 22203029

Change-Id: I737332a487c41e0a93d161b55659700a1f936844
2015-08-19 15:18:55 -04:00
Tony Mantler
67cd6ab93a Move ApplicationsState to SettingsLib
Also take InterestingConfigChanges along for the ride
and delete unused AppPermissionSettings

b/21328967

Change-Id: I4d0c1a27054845a54cf68e95a92024d2e46f636e
2015-06-08 14:41:02 -07:00
Jason Monk
63fbf68a42 Fix updates of the enable/disable button
Make the entire ApplicationsState resume and do way too much work
so that we can get a little bit of state.

ApplicationsState could use some refactoring.

Bug: 21518528
Change-Id: Ibb6a2c15948f9bc69490426d4004dc83582087b4
2015-06-04 10:57:31 -04:00
Jason Monk
44fb627cf6 Merge "Don't have app info pages load so much info" into mnc-dev 2015-05-26 20:20:38 +00:00
Jason Monk
646befdd16 Don't have app info pages load so much info
They don't need to resume the ApplicationsState session because they
only need info for one app, instead just make sure ApplicationsState
can load the info as requested.

Bug: 20696893
Change-Id: I146387438348fad1396ac4528819b2f1a93a97bf
2015-05-26 16:20:09 -04:00
Jason Monk
5e2529aeb4 Fix crash while rotating with app info dialog up
Bug: 21037445
Change-Id: Ie5b0f8aa04913d0ab781be334c6c305db97235a0
2015-05-26 15:12:18 -04:00
Jason Monk
65ecadc625 Try not to crash while AppInfo is finishing
Bug: 21025020
Change-Id: Iebb9e6b24ca503f87b5648f0aaf02dde01903488
2015-05-15 13:07:45 -04:00
Jason Monk
255452fdf4 Start app notifications as fragment not intent
This lets it show the back arrow when coming from within the settings
app.

Bug: 20561808
Change-Id: I103c8fb74197c5a0530c363a234da5e2148726a7
2015-05-13 11:36:45 -04:00
Jason Monk
20f464edde Fix app headers in settings
Use SettingsPreferenceFragment's method for pinned headers where
possible, and add a frame within the fragment for them to live in
otherwise so that this view doesn't end up on the activity.

Bug: 20886475
Change-Id: I985eb1497744ea50bfabed862e5088eb89df5b61
2015-05-06 16:00:25 -04:00
Jason Monk
1eb54eb2ff Add high power whitelist for apps
- Strings not final!
 - New UX for power usage details (more preferency)
 - Add high power apps list shows on/off and screen to
   change (when possible)
 - Link from power usage summary to high power list
 - Link from advanced apps to high power list

Bug: 19991702
Change-Id: I97c927ed82d3b89041e4429b427508545763d66c
2015-05-04 14:38:01 -04:00
Jason Monk
d8da51ccfe New UX for app usage screen
Now uses ManageApplications base, and has a details screen which has
a switch and a link to optional app settings.

Bug: 20290386
Change-Id: If32ce8d82e55f3908644c575925b3f6506a68e6e
2015-04-23 10:37:59 -04:00