sb.append(auth);
          }
          if (params.getTriggeredContentUris() != null) {
              for (Uri uri : params.getTriggeredContentUris()) {
                  sb.append("\n");
                  sb.append(uri);
              }
          }
      } else {
          sb.append("(No content)");
      }
      Log.i(TAG, sb.toString());
      return true;
    }
    

##  Further optimize your app

Optimizing your apps to run on low-memory devices, or in low-memory
conditions, can improve performance and user experience. Removing dependencies
on background services and manifest-registered implicit broadcast receivers
can help your app run better on such devices. Although Android 7.0 (API level
24) takes steps to reduce some of these issues, it is recommended that you
optimize your app to run without the use of these background processes
entirely.

The following [ Android Debug Bridge (ADB) ](/tools/help/adb) commands can
help you test app behavior with background processes disabled:

  * To simulate conditions where implicit broadcasts and background services are unavailable, enter the following command: 
  *     $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND ignore
    

  * To re-enable implicit broadcasts and background services, enter the following command: 
  *     $ adb shell cmd appops set <package_name> RUN_IN_BACKGROUND allow
    

  * You can simulate the user placing your app in the "restricted" state for background battery usage. This setting prevents your app from being able to run in the background. To do so, run the following command in a terminal window: 
  *     $ adb shell cmd appops set <PACKAGE_NAME> RUN_ANY_IN_BACKGROUND deny
    

Content and code samples on this page are subject to the licenses described in
the [ Content License ](/license) . Java and OpenJDK are trademarks or
registered trademarks of Oracle and/or its affiliates.

Last updated 2024-03-20 UTC.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing
the information I need" },{ "type": "thumb-down", "id":
"tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{
"type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type":
"thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{
"type": "thumb-down", "id": "otherDown", "label":"Other" }]  [{ "type":
"thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type":
"thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type":
"thumb-up", "id": "otherUp", "label":"Other" }]

  * [ ![X](/_static/android/images/logo-x.svg) X ](//x.com/AndroidDev)

Follow @AndroidDev on X

  * [ ![YouTube](//www.gstatic.com/images/icons/material/product/2x/youtube_48dp.png) YouTube ](//www.youtube.com/user/androiddevelopers)

Check out Android Developers on YouTube

  * [ ![LinkedIn](/_static/android/images/logo-linkedin.svg) LinkedIn ](//www.linkedin.com/showcase/androiddev)

Connect with the Android Developers community on LinkedIn

  * ###  More Android 

    * [ Android ](//www.android.com)
    * [ Android for Enterprise ](//www.android.com/enterprise/)
    * [ Security ](//www.android.com/security-center/)
    * [ Source ](//source.android.com)
    * [ News ](/news)
    * [ Blog ](//android-developers.googleblog.com/)
    * [ Podcasts ](/podcasts)
  * ###  Discover 

    * [ Gaming ](/games)
    * [ Machine Learning ](/ml)
    * [ Privacy ](/privacy)
    * [ 5G ](/training/connectivity/5g)
  * ###  Android Devices 

    * [ Large screens ](/large-screens)
    * [ Wear OS ](/wear)
    * [ ChromeOS devices ](/chrome-os)
    * [ Android for cars ](/cars)
    * [ Android TV ](/tv)
  * ###  Releases 

    * [ Android 14 ](/about/versions/14)
    * [ Android 13 ](/about/versions/13)
    * [ Android 12 ](/about/versions/12)
    * [ Android 11 ](/about/versions/11)
    * [ Android 10 ](/about/versions/10)
    * [ Pie ](/about/versions/pie)
    * [ Oreo ](/about/versions/oreo)
    * [ Nougat ](/abou