aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-08-18 20:55:10 +0300
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-08-20 18:07:38 +0300
commit2059ea69085224408d5355c98338f5243ac82ff3 (patch)
tree08d6d25c7ff50ae14297c00c47f738194a768213
parentc349280cf8f7754fb0bfe21554427e8a77708326 (diff)
downloadvendor_cmsdk-2059ea69085224408d5355c98338f5243ac82ff3.zip
vendor_cmsdk-2059ea69085224408d5355c98338f5243ac82ff3.tar.gz
vendor_cmsdk-2059ea69085224408d5355c98338f5243ac82ff3.tar.bz2
You are now a developer!
* Show alternative brand logo in dexopt screen when developer options are enabled * Drawable by Asher Change-Id: Ie100d7c3e9c96a7ad64c4cd65195d6f531090140
-rw-r--r--cm/res/res/drawable/dexopt_brand_logo_alternative.xml28
-rw-r--r--cm/res/res/layout/dexopt_dialog.xml1
-rw-r--r--cm/res/res/values/symbols.xml2
-rw-r--r--sdk/src/java/org/cyanogenmod/internal/BootDexoptDialog.java18
4 files changed, 47 insertions, 2 deletions
diff --git a/cm/res/res/drawable/dexopt_brand_logo_alternative.xml b/cm/res/res/drawable/dexopt_brand_logo_alternative.xml
new file mode 100644
index 0000000..9326610
--- /dev/null
+++ b/cm/res/res/drawable/dexopt_brand_logo_alternative.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2016 The CyanogenMod 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="96dp"
+ android:height="90dp"
+ android:viewportWidth="96"
+ android:viewportHeight="90">
+
+ <path
+ android:fillColor="@color/dexopt_logo"
+ android:pathData="M96,38.58V67.64c0,16.8-16.21,21.74-45.22,22H43.6v0c-28-.46-43.6-5.52-43.6-22V38.58c0-9,4.64-14.55,13.37-17.86L6.79,4.65A3.14,3.14,0,1,1,12.6,2.27l6.82,16.65c6.54-1.5,14.64-2.19,24.18-2.35h0c1.43,0,2.89,0,4.39,0v0h0v0c11.47,0,21.06
+.66
+,28.58,2.38L83.4,2.27a3.14,3.14,0,1,1,5.81,2.38L82.63,20.72C91.36,24,96,29.61,96,38.58ZM42.47,73.13c0,.08,0,.16,0,.24a4,4,0,0,0,4,4h3a4,4,0,0,0,4-4c0-.08,0-.16,0-.24ZM10,50.68a14.36,14.36,0,1,0,28.35,1L11.45,46.54A14.36,14.36,0,0,0,10,50.68Zm74.59-4.15L57.69,51.72a14.36,14.36,0,1,0,26.86-5.18Z" />
+</vector>
diff --git a/cm/res/res/layout/dexopt_dialog.xml b/cm/res/res/layout/dexopt_dialog.xml
index a8707ca..0b13f9e 100644
--- a/cm/res/res/layout/dexopt_dialog.xml
+++ b/cm/res/res/layout/dexopt_dialog.xml
@@ -29,6 +29,7 @@
android:elevation="8dp">
<ImageView
+ android:id="@+id/dexopt_logo_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dexopt_bottom_height"
diff --git a/cm/res/res/values/symbols.xml b/cm/res/res/values/symbols.xml
index c183713..874b49d 100644
--- a/cm/res/res/values/symbols.xml
+++ b/cm/res/res/values/symbols.xml
@@ -132,6 +132,7 @@
<!-- Boot dexopt dialog -->
<java-symbol type="bool" name="config_bootDexoptHideAppDetails" />
<java-symbol type="drawable" name="dexopt_brand_logo" />
+ <java-symbol type="drawable" name="dexopt_brand_logo_alternative" />
<java-symbol type="drawable" name="ic_device_bg" />
<java-symbol type="drawable" name="ic_device" />
<java-symbol type="drawable" name="ic_dexopt_obscured" />
@@ -140,6 +141,7 @@
<java-symbol type="drawable" name="ic_droid" />
<java-symbol type="layout" name="dexopt_dialog" />
<java-symbol type="id" name="dexopt_icon" />
+ <java-symbol type="id" name="dexopt_logo_view" />
<java-symbol type="id" name="dexopt_message" />
<java-symbol type="id" name="dexopt_message_detail" />
<java-symbol type="id" name="dexopt_progress" />
diff --git a/sdk/src/java/org/cyanogenmod/internal/BootDexoptDialog.java b/sdk/src/java/org/cyanogenmod/internal/BootDexoptDialog.java
index 89dd676..b0c9d74 100644
--- a/sdk/src/java/org/cyanogenmod/internal/BootDexoptDialog.java
+++ b/sdk/src/java/org/cyanogenmod/internal/BootDexoptDialog.java
@@ -18,11 +18,13 @@ package org.cyanogenmod.internal;
import android.app.Dialog;
import android.app.IActivityManager;
+import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
+import android.provider.Settings;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
@@ -52,7 +54,14 @@ public class BootDexoptDialog extends Dialog {
public static BootDexoptDialog create(Context context, int windowType) {
final PackageManager pm = context.getPackageManager();
+ final int brandLogo;
final int theme;
+ if (Settings.Global.getInt(context.getContentResolver(),
+ Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0) == 1) {
+ brandLogo = R.drawable.dexopt_brand_logo_alternative;
+ } else {
+ brandLogo = R.drawable.dexopt_brand_logo;
+ }
if (pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
|| pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)) {
theme = com.android.internal.R.style.Theme_Micro_Dialog_Alert;
@@ -62,10 +71,11 @@ public class BootDexoptDialog extends Dialog {
theme = com.android.internal.R.style.Theme_Material_Light;
}
- return new BootDexoptDialog(context, theme, windowType);
+ return new BootDexoptDialog(context, theme, windowType, brandLogo);
}
- private BootDexoptDialog(Context context, int themeResId, int windowType) {
+ private BootDexoptDialog(Context context, int themeResId, int windowType,
+ int brandLogoResId) {
super(context, themeResId);
mHideAppDetails = context.getResources().getBoolean(
R.bool.config_bootDexoptHideAppDetails);
@@ -76,6 +86,10 @@ public class BootDexoptDialog extends Dialog {
}
setContentView(R.layout.dexopt_dialog);
+
+ final ImageView brandLogo = (ImageView) findViewById(R.id.dexopt_logo_view);
+ brandLogo.setImageResource(brandLogoResId);
+
mMessage = (TextView) findViewById(R.id.dexopt_message);
mDetailMsg = (TextView) findViewById(R.id.dexopt_message_detail);
mAppIcon = (ImageView) findViewById(R.id.dexopt_icon);