Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13ca413f authored by Andrew Sapperstein's avatar Andrew Sapperstein Committed by Doris Ling
Browse files

Provide custom icon/title for OTA_UPDATE_UID

Sets the icon and title in the app data usage list.

Bug: 70640191
Test: manually verified locally that there is an item in the list
with the proper title. Required setting up a custom OTA for my
test device.

Change-Id: I366ce07d25194b5214635a35378cad1fca7d54fa
parent 03f6205e
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
<!--
    Copyright (C) 2017 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0"
        android:tint="?android:attr/colorControlNormal">
    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M17,1.01L7,1C5.9,1 5,1.9 5,3v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3C19,1.9 18.1,1.01 17,1.01zM17,21H7l0,-1h10V21zM17,18H7V6h10V18zM7,4V3h10v1H7zM16,12.5l-4,4l-4,-4l1.41,-1.41L11,12.67V8.5V8h2v0.5v4.17l1.59,-1.59L16,12.5z"/>
</vector>
+3 −0
Original line number Diff line number Diff line
@@ -337,6 +337,9 @@
    <string name="data_usage_uninstalled_apps">Removed apps</string>
    <!-- Title of data usage item that represents all uninstalled applications or removed users. [CHAR LIMIT=48] -->
    <string name="data_usage_uninstalled_apps_users">Removed apps and users</string>
    <!-- Title of data usage item that represents system updates (OTAs). [CHAR LIMIT=48] -->
    <string name="data_usage_ota">System updates</string>


    <!-- Tethering controls, item title to go into the tethering settings -->
    <!-- Tethering controls, item title to go into the tethering settings when only USB tethering is available [CHAR LIMIT=25]-->
+6 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.TrafficStats;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
@@ -111,7 +112,7 @@ public class UidDetailProvider {

        // handle special case labels
        switch (uid) {
            case android.os.Process.SYSTEM_UID:
            case Process.SYSTEM_UID:
                detail.label = res.getString(R.string.process_kernel_label);
                detail.icon = pm.getDefaultActivityIcon();
                return detail;
@@ -127,6 +128,10 @@ public class UidDetailProvider {
                detail.label = res.getString(Utils.getTetheringLabel(cm));
                detail.icon = pm.getDefaultActivityIcon();
                return detail;
            case Process.OTA_UPDATE_UID:
                detail.label = res.getString(R.string.data_usage_ota);
                detail.icon = mContext.getDrawable(R.drawable.ic_system_update);
                return detail;
        }

        final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);