Messaging: Fix a few android related things

* NotificationBuilder.addPerson(String) -> .addPerson(Person)
* Wearableextenter.addPage deprecated without replacement
* Html.fromHtml(String) -> .fromHtml(String, int)
* Handlers need Loopers
* Resource-IDs are not final by default (if-else instead of switch-case)
* call super.onFinishInflate() in override of onFinishInflate()
* Configuration.locale -> configuration.getLocales().get(0)
* SimpleDateFormat needs localization as well
* AudioAttributes instead of setAudioStreamType()
* isDataEnabled() is a public method, no need for reflection anymore

Change-Id: Icd830768b86edca3e0b44f1edc6c57facc9f731a
This commit is contained in:
Michael W
2024-12-26 15:54:37 +01:00
parent e128bff457
commit d940ab74ad
33 changed files with 313 additions and 388 deletions
@@ -122,16 +122,15 @@ public class AudioRecordView extends FrameLayout implements
mSoundLevels.setLevelSource(mMediaRecorder.getLevelSource());
mRecordButton.setOnTouchListener((v, event) -> {
final int action = event.getActionMasked();
switch (action) {
case MotionEvent.ACTION_DOWN:
onRecordButtonTouchDown();
if (action == MotionEvent.ACTION_DOWN) {
onRecordButtonTouchDown();
// Don't let the record button handle the down event to let it fall through
// so that we can handle it for the entire panel in onTouchEvent(). This is
// done so that: 1) the user taps on the record button to start recording
// 2) the entire panel owns the touch event so we'd keep recording even
// if the user moves outside the button region.
return false;
// Don't let the record button handle the down event to let it fall through
// so that we can handle it for the entire panel in onTouchEvent(). This is
// done so that: 1) the user taps on the record button to start recording
// 2) the entire panel owns the touch event so we'd keep recording even
// if the user moves outside the button region.
return false;
}
return false;
});
@@ -29,6 +29,7 @@ import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.RectF;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
@@ -115,7 +116,7 @@ public class PieRenderer extends OverlayRenderer
private LinearAnimation mFadeIn;
private volatile boolean mFocusCancelled;
private final Handler mHandler = new Handler() {
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
public void handleMessage(Message msg) {
switch(msg.what) {
case MSG_OPEN: