Messaging: Remove unused code

Change-Id: I8093bb3e305ae323f7069bf42f9e83f8c8647cc7
This commit is contained in:
Michael W
2024-12-26 15:54:37 +01:00
parent 0069df879a
commit e29b158fba
69 changed files with 42 additions and 3228 deletions
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,47 +28,16 @@ import javax.annotation.concurrent.ThreadSafe;
@ThreadSafe
public class AudioLevelSource {
private volatile int mSpeechLevel;
private volatile Listener mListener;
public static final int LEVEL_UNKNOWN = -1;
public interface Listener {
void onSpeechLevel(int speechLevel);
}
public void setSpeechLevel(int speechLevel) {
Preconditions.checkArgument(speechLevel >= 0 && speechLevel <= 100 ||
speechLevel == LEVEL_UNKNOWN);
mSpeechLevel = speechLevel;
maybeNotify();
}
public int getSpeechLevel() {
return mSpeechLevel;
}
public void reset() {
setSpeechLevel(LEVEL_UNKNOWN);
}
public boolean isValid() {
return mSpeechLevel > 0;
}
private void maybeNotify() {
final Listener l = mListener;
if (l != null) {
l.onSpeechLevel(mSpeechLevel);
}
}
public synchronized void setListener(Listener listener) {
mListener = listener;
}
public synchronized void clearListener(Listener listener) {
if (mListener == listener) {
mListener = null;
}
}
}
@@ -111,11 +111,6 @@ public class AudioRecordView extends FrameLayout implements
mHostInterface = hostInterface;
}
@VisibleForTesting
public void testSetMediaRecorder(final LevelTrackingMediaRecorder recorder) {
mMediaRecorder = recorder;
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
@@ -17,7 +17,6 @@
package com.android.messaging.ui.mediapicker.camerafocus;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.drawable.Drawable;
@@ -47,7 +46,6 @@ public class PieItem {
private List<PieItem> mItems;
private Path mPath;
private OnClickListener mOnClickListener;
private float mAlpha;
// Gray out the view when disabled
private static final float ENABLED_ALPHA = 1;
@@ -87,12 +85,7 @@ public class PieItem {
return mPath;
}
public void setChangeAlphaWhenDisabled (boolean enable) {
mChangeAlphaWhenDisabled = enable;
}
public void setAlpha(float alpha) {
mAlpha = alpha;
mDrawable.setAlpha((int) (255 * alpha));
}
@@ -138,11 +131,6 @@ public class PieItem {
outer = outside;
}
public void setFixedSlice(float center, float sweep) {
mCenter = center;
this.sweep = sweep;
}
public float getCenter() {
return mCenter;
}
@@ -192,12 +180,4 @@ public class PieItem {
public void draw(Canvas canvas) {
mDrawable.draw(canvas);
}
public void setImageResource(Context context, int resId) {
Drawable d = context.getResources().getDrawable(resId).mutate();
d.setBounds(mDrawable.getBounds());
mDrawable = d;
setAlpha(mAlpha);
}
}